Mobile app to calculate the user health score and issue Medits tokens
keytool -exportcert -list -v -alias androiddebugkey -keystore ~/.android/debug.keystore
The password is android.
Copy the SHA-1 value, which will look something like this in the output:
Certificate Fingerprints
SHA1: aa:bb:cc:dd:ee:ff:11:22:33:44:47:D0:9E:8D:E0:0C:79:F1:0F:CB
Now open up your Android App in the Firebase console and add the SHA-1:
Connect the iOS or Android phones with a USB cable to the computer and follow the following steps:
./scripts/run_release_ios.sh
./scripts/run_release_android.sh
Storybook is used to develop and modify components. To run Storybook, run the commands below:
npm run storybook
and from another terminal run:
react-native run-ios
Please follow this guide to add a new custom font:
Custom Fonts in React Native for iOS & Android Builds
-
Close the project
-
Re-open it
-
Try to fix any wrong dependency version
-
Android Studio -> File -> Invalidate Caches/ Restart
The app crashes at startup. Here is the procedure to follow in this case:
-
Attach an Android phone with the release version of the app to the computer.
-
Run Android studio and select the phone and application i the Logcat window. Filter the message with Error instead of Verbose
-
Run the app and after the crash look at the log
-
Example: In one case the log said: Got JS Exception: Unexpected token '.' (index.android.bundle:1054) This error happens in the release version of the app.
-
Now, we have to look at the index.android.bundle file in android/app/buil/intermediates/assets/release and go to line 1054.
-
In that line, look for suspicious code. In this example, it was if (new.target === DataSource). This is not supported yet by the Android Javascript engine and we need either to not use the syntax or add the babel plugin babel-plugin-transform-new-target to transpile the code.
When modules are not loading, check if all imports in MainApplication.java and dependencies are there. One missing dependency or import and the build can break with cryptic error messages.
error: Build input file cannot be found: '.../node_modules/react-native/third-party/double-conversion-1.1.5/src/fixed-dtoa.cc'
If you are a new Xcode, you might have this error. React Native libraries are slow to move to the new iOS libraries. Make sure you are using legacy build system.
Xcode -> File -> Workspace Settings ...
AppleHealthKit from 'rn-apple-healthkit' doesn't return from the Native calls and blocks the fetch code
Make sure to always call AppleHealthKit.initHealthKit() before anu other call to the rn-apple-healthkit otherwise the native module silently blocks the Health Kit query thread and you can spend hours debugging the problem.
OS | Status |
---|---|
Android | |
iOS |