Fakultas Ilmu Komputer UI

Commit 7da26926 authored by Nandhika Prayoga's avatar Nandhika Prayoga
Browse files

Merge branch 'coldfix-sprint_3' into 'staging'

Refactor Sprint 3

See merge request !31
parents 9a65c012 4fa9c8c9
......@@ -72,6 +72,7 @@ buck-out/
# Testing
coverage
**/__snapshots__/
# Sonarqube
.sonar/
......
......@@ -9,7 +9,7 @@ The repository for TBACare mobile codebase
- [Smartphone setup](#smartphone-setup)
- [Emulator setup](#emulator-setup)
- [Emulator script](#emulator-script)
- [Start](#start)
- [Commands](#commands)
- [Troubleshooting](#troubleshooting)
- [Maintainers](#maintainers)
......@@ -98,8 +98,8 @@ npm i
- Check "Android Emulator" checkbox
- Click "OK"
```
### **Start**
Assume you already setted up your smartphone/emulator.
### **Commands**
Assume you have setted up everything.
* #### Run android
```
npx react-native run-android
......@@ -108,8 +108,13 @@ Assume you already setted up your smartphone/emulator.
```
npx react-native run-ios
```
* #### Build APK locally
```
cd android
gradlew assembleRelease || ./gradlew assembleRelease
```
## **Troubleshooting**
## **Troubleshootings**
* ### **Uncleaned gradlew**
```bash
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
......@@ -117,11 +122,7 @@ Assume you already setted up your smartphone/emulator.
```
Go inside android directory and run this command
```bash
gradlew clean
```
or
```
./gradlew clean
gradlew clean || ./gradlew clean
```
* ### **Caching problem**
Clear your cache by this command.
......@@ -132,6 +133,8 @@ Assume you already setted up your smartphone/emulator.
#### **Unix**
```bash
watchman watch-del-all && rm -rf $TMPDIR/react-native-packager-cache-* && rm -rf $TMPDIR/metro-bundler-cache-* && rm -rf node_modules/ && npm cache clean --force && npm install && npm start -- --reset-cache
cd android
./gradlew clean
```
* ### **Corrupt modules**
If clearing caches doesn't work or sometimes you face an error such as *"Cannot find module..."*. This could be due to a corrupt installation, then try to follow this procedure.
......
......@@ -35,12 +35,12 @@ android_library(
android_build_config(
name = "build_config",
package = "com.ppti_mobile",
package = "com.tbcare",
)
android_resource(
name = "res",
package = "com.ppti_mobile",
package = "com.tbcare",
res = "src/main/res",
)
......
......@@ -141,7 +141,7 @@ android {
}
defaultConfig {
applicationId "com.ppti_mobile"
applicationId "com.tbcare"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ppti_mobile">
package="com.tbcare">
<uses-permission android:name="android.permission.INTERNET" />
......
package com.ppti_mobile;
package com.tbcare;
import com.facebook.react.ReactActivity;
......@@ -10,6 +10,6 @@ public class MainActivity extends ReactActivity {
*/
@Override
protected String getMainComponentName() {
return "ppti_mobile";
return "tbcare";
}
}
package com.ppti_mobile;
package com.tbcare;
import android.app.Application;
import android.content.Context;
......
<resources>
<string name="app_name">ppti_mobile</string>
<string name="app_name">TBCare</string>
</resources>
rootProject.name = 'ppti_mobile'
rootProject.name = 'tbcare'
include ':@react-native-community_async-storage'
project(':@react-native-community_async-storage').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-community/async-storage/android')
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
......
{
"name": "ppti_mobile",
"displayName": "ppti_mobile"
"name": "tbcare",
"displayName": "TBCare"
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment