The Problem
I've released latest version of application to production on Play Store.
- If I download and install the generated APK, it works fine.
- But if I download the same version from Play Store, the application doesn't load or crash. While making the release I uploaded the Android App Bundle and not the APK and did not upload debug symbols on Play console.
- I've tried running the application, (both the APK and from Play Store), on physical devices as well as Android simulators.
- Since the application is running fine in debug mode and by installing the APK (and works on iOS), I think that issue is not related to react code but to some configuration issue??
- Built with React Native 0.60.4
Logs
Below are the logs from logcat while running the app downloaded from Play Store in Android Studio Simulator. There are a couple errors in the end where the execution stops. It seems that the error is shown whenever it is not able to find a native dependency in any of the predetermined locations.
Even while running the APK, I get the same logs but the execution continues and finishes to launch the application and fetch data from the server.
> 2020-08-17 22:39:02.997 4719-4719/? D/SoLoader: libyoga.so not found on /data/data/com.abc.testapp/lib-main
> 2020-08-17 22:39:02.997 4719-4719/? D/SoLoader: libyoga.so not found on /data/data/com.abc.testapp/lib-0
> 2020-08-17 22:39:02.997 4719-4719/? D/SoLoader: libyoga.so found on /data/data/com.abc.testapp/lib-1
> 2020-08-17 22:39:03.002 4719-4719/? D/SoLoader: libjsinspector.so not found on /data/data/com.abc.testapp/lib-main
> 2020-08-17 22:39:03.002 4719-4719/? D/SoLoader: libjsinspector.so not found on /data/data/com.abc.testapp/lib-0
> 2020-08-17 22:39:03.002 4719-4719/? D/SoLoader: libjsinspector.so found on /data/data/com.abc.testapp/lib-1
> 2020-08-17 22:39:03.003 4719-4719/? D/SoLoader: libfolly_json.so not found on /data/data/com.abc.testapp/lib-main
> 2020-08-17 22:39:03.003 4719-4719/? D/SoLoader: libfolly_json.so not found on /data/data/com.abc.testapp/lib-0
> 2020-08-17 22:39:03.003 4719-4719/? D/SoLoader: libfolly_json.so found on /data/data/com.abc.testapp/lib-1
> 2020-08-17 22:39:03.011 4719-4719/? D/SoLoader: libjsc.so not found on /data/data/com.abc.testapp/lib-main
> 2020-08-17 22:39:03.011 4719-4719/? D/SoLoader: libjsc.so not found on /data/data/com.abc.testapp/lib-0
> 2020-08-17 22:39:03.011 4719-4719/? D/SoLoader: libjsc.so not found on /data/data/com.abc.testapp/lib-1
> 2020-08-17 22:39:03.011 4719-4719/? D/SoLoader: libjsc.so not found on /data/data/com.abc.testapp/lib-2
> 2020-08-17 22:39:03.011 4719-4719/? D/SoLoader: libjsc.so not found on /data/app/com.abc.testapp-ue_qPUdXT8TbbZBF3aKjsA==/lib/x86
> 2020-08-17 22:39:02.977 4719-4719/? W/abc.testapp: type=1400 audit(0.0:559): avc: granted { execute } for path="/data/data/com.abc.testapp/lib-1/libfb.so" dev="vdc" ino=147513 scontext=u:r:untrusted_app_27:s0:c146,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c146,c256,c512,c768 tclass=file
> 2020-08-17 22:39:02.977 4719-4719/? W/abc.testapp: type=1400 audit(0.0:560): avc: granted { execute } for path="/data/data/com.abc.testapp/lib-1/libglog.so" dev="vdc" ino=147516 scontext=u:r:untrusted_app_27:s0:c146,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c146,c256,c512,c768 tclass=file
> 2020-08-17 22:39:02.977 4719-4719/? W/abc.testapp: type=1400 audit(0.0:561): avc: granted { execute } for path="/data/data/com.abc.testapp/lib-1/libglog_init.so" dev="vdc" ino=147518 scontext=u:r:untrusted_app_27:s0:c146,c256,c512,c768 tcontext=u:object_r:app_data_file:s0:c146,c256,c512,c768 tclass=file
> 2020-08-17 22:39:03.381 1814-1814/? E/Layer: [Surface(name=AppWindowToken{ab7a8d4 token=Token{81bde27 ActivityRecord{9318e6 u0 com.abc.testapp/.MainActivity t205}}})/@0x356d6b1 - animation-leash#0] No local sync point found
> 2020-08-17 22:39:03.381 1814-1814/? E/Layer: [Surface(name=AppWindowToken{ab7a8d4 token=Token{81bde27 ActivityRecord{9318e6 u0 com.abc.testapp/.MainActivity t205}}})/@0x356d6b1 - animation-leash#0] No local sync point found
Stuff that I've looked into:
Fixing the error shown above
I've tried following this answer https://stackoverflow.com/a/56778060/12246335 but it started producing APK with sizes twice as before and app kept crashing.
This answer https://stackoverflow.com/a/59626013/12246335 suggests enabling cleartext traffic. I went through the docs but couldn't see how this would be useful, also it mentioned security issues upon adding this option.
The configuration in AndroidManifest.xml shows that currently the cleartext traffic is enabled for debug mode and not for release mode.
Updating gradle and gradle plugin version
- I have tried updating gradle and plugin versions to the latest releases. The APK builds and runs fine but the error above is still there in the logcat. So, I feel that the Play Store release with this will be no different and will stop execution with the above errors.
Any help/suggestion is appreciated. Thank you.