While trying to run the app in release mode on Android, there are potential issue you can run into:
If you see this error: AAPT: error: resource android:attr/colorError not found. follow this post and add this to your android build.gradle file:
subprojects {
afterEvaluate {
project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion = 28
buildToolsVersion = "28.0.3"
}
}
}
}
This forces the app to use the specific SDK version for building.
If you see this error: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libhermes.so result: 0 follow this post and add this line to your app build.gradle file:
implementation 'com.facebook.soloader:soloader:0.9.0+'
This updates the soloader which should solve an issue where JSC-Android wouldn't load (the libhermes error isn't actually correct in this case).
Issues Building in Xcode for iOS for RN < 0.6
If you happen to receive an error message stating
Unknown argument type '__attribute__' in method -[rctappstate getcurrentappstate:error] ... etc.
refer to this post for a fix: facebook/react-native#25146Also, upgrading to RN 0.59.10 may resolve the issue.
If you are building the project in Xcode for iOS testing, some issues during the build process may occur:
If you run into an error trying to use custom fonts/icons (or potentiall other resources in an 'Assets' folder, consider using the following command:
react-native link
This should import information from the 'Assets' folder into a 'Resources' folder. This 'Resources' folder is what Xcode uses for assets, so if it is not linked up with the correct information, errors may occur.
For more information, this article may be helpful: link
If you are using Xcode 11 or later and the React Native version in the project is 59.8 or earlier, you may run into an error message like:
unknown argument type '__attribute__' in method...
you are most likely facing a known issue with debugger code. Here are steps you can follow to implement the 59.9 RN version fix in earlier versions if you cannot updgrade: link (link to the actual file you need to change)