1
votes

The debug version of the app I'm working on works. However, when I build an apk for it, the app crashes immediately after I attempt to start it.

Here is the info/messages I receive when I install the debug version:

Task :react-native-fbsdk:compileDebugJavaWithJavac Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/someguy/projects/third/some-app/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Task :react-native-google-analytics-bridge:compileDebugJavaWithJavac Note: /Users/someguy/projects/third/some-app/node_modules/react-native-google-analytics-bridge/android/src/main/java/com/idehub/GoogleAnalyticsBridge/ConvertToWritable.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Task :react-native-i18n:compileDebugJavaWithJavac Note: /Users/someguy/projects/third/some-app/node_modules/react-native-i18n/android/src/main/java/com/AlexanderZaytsev/RNI18n/RNI18nModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

Task :react-native-picker:compileDebugJavaWithJavac Note: /Users/someguy/projects/third/some-app/node_modules/react-native-picker/android/src/main/java/com/beefe/picker/PickerViewModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

Task :app:compileDebugJavaWithJavac Note: /Users/someguy/projects/third/some-app/android/app/src/main/java/com/someapp/tone/Tone.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/someguy/projects/third/some-app/android/app/src/main/java/com/someapp/fitting/OVFitting.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

Task :app:externalNativeBuildDebug Build somefittingjni x86 [1/2] Building CXX object CMakeFiles/somefittingjni.dir/src/main/cpp/somefittingjni.cpp.o [2/2] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/x86/libsomefittingjni.so Build somefittingjni armeabi-v7a [1/2] Building CXX object CMakeFiles/somefittingjni.dir/src/main/cpp/somefittingjni.cpp.o [2/2] Linking CXX shared library ../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libsomefittingjni.so

Task :app:transformNativeLibsWithStripDebugSymbolForDebug Unable to strip library '/Users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libgifimage.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is. Unable to strip library '/Users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libicu_common.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is. Unable to strip library '/Users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libimagepipeline.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is.

Task :app:installDebug 03:46:57 V/ddms: execute: running am get-config 03:46:57 V/ddms: execute 'am get-config' on 'randonnumber' : EOF hit. Read: -1 03:46:57 V/ddms: execute: returning Installing APK 'app-debug.apk' on 'SM-G950N - 8.0.0' for app:debug 03:46:57 D/app-debug.apk: Uploading app-debug.apk onto device 'randonnumber' 03:46:57 D/Device: Uploading file onto device 'randonnumber' 03:46:57 D/ddms: Reading file permision of /Users/someguy/projects/third/some-app/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r-- 03:46:59 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk" 03:47:13 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'randonnumber' : EOF hit. Read: -1 03:47:13 V/ddms: execute: returning 03:47:13 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk" 03:47:13 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'randonnumber' : EOF hit. Read: -1 03:47:13 V/ddms: execute: returning Installed on 1 device.

BUILD SUCCESSFUL in 29s 265 actionable tasks: 250 executed, 15 up-to-date

When creating an apk, I get the following warnings, but the apk still gets created:

> Task :react-native-fbsdk:compileReleaseJavaWithJavac 
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/someguy/projects/third/someapp/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java

uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

> Task :react-native-google-analytics-bridge:compileReleaseJavaWithJavac 
Note: /Users/someguy/projects/third/someapp/node_modules/react-native-google-analytics-bridge/android/src/main/java/com/idehub/GoogleAnalyticsBridge/ConvertToWritable.java

uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

> Task :react-native-i18n:compileReleaseJavaWithJavac 
Note: /Users/someguy/projects/third/someapp/node_modules/react-native-i18n/android/src/main/java/com/AlexanderZaytsev/RNI18n/RNI18nModule.java

uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-picker:compileReleaseJavaWithJavac 
Note: /Users/someguy/projects/third/someapp/node_modules/react-native-picker/android/src/main/java/com/beefe/picker/PickerViewModule.java

uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details.

> Task :app:compileReleaseJavaWithJavac 
Note: /Users/someguy/projects/third/someapp/android/app/src/main/java/com/someapp/tone/Tone.java

uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: /Users/someguy/projects/third/someapp/android/app/src/main/java/com/someapp/fitting/OVFitting.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details.

> Task :app:externalNativeBuildRelease 
Build somefittingjni x86
[1/2] Building CXX object CMakeFiles/somefittingjni.dir/src/main/cpp/somefittingjni.cpp.o
[2/2] Linking CXX shared library ../../../../build/intermediates/cmake/release/obj/x86/libsomefittingjni.so
Build somefittingjni armeabi-v7a
[1/2] Building CXX object CMakeFiles/somefittingjni.dir/src/main/cpp/somefittingjni.cpp.o
[2/2] Linking CXX shared library ../../../../build/intermediates/cmake/release/obj/armeabi-v7a/libsomefittingjni.so

> Task :app:transformNativeLibsWithStripDebugSymbolForRelease 
Unable to strip library '/Users/someguy/projects/third/someapp/android/app/build/intermediates/transforms/mergeJniLibs/release/0/lib/armeabi/libgifimage.so'

due to missing strip tool for ABI 'ARMEABI'. Packaging it as is. Unable to strip library '/Users/someguy/projects/third/someapp/android/app/build/intermediates/transforms/mergeJniLibs/release/0/lib/armeabi/libicu_common.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is. Unable to strip library '/Users/someguy/projects/third/someapp/android/app/build/intermediates/transforms/mergeJniLibs/release/0/lib/armeabi/libimagepipeline.so' due to missing strip tool for ABI 'ARMEABI'. Packaging it as is.

After those warnings show up. I get the following message(s):

W/ResourceType( 4289): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1320)

W/ResourceType( 4289): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1320)

W/ResourceType( 4289): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1266)
W/ResourceType( 4289): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1266)
W/ResourceType( 4289): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1266)
W/ResourceType( 4289): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1266)

W/ResourceType( 4289): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1329)
W/ResourceType( 4289): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1329)
W/ResourceType( 4289): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1329)
W/ResourceType( 4289): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1329)

W/ResourceType( 4289): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1266)
W/ResourceType( 4289): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1266)
W/ResourceType( 4289): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1266)
W/ResourceType( 4289): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1266)

W/ResourceType( 4289): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1329)
W/ResourceType( 4289): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1329)
W/ResourceType( 4289): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1329)
W/ResourceType( 4289): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1329)

W/ResourceType( 4289): For resource 0x0101053d, entry index(1341) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053e, entry index(1342) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053b, entry index(1339) is beyond type entryCount(1320)
W/ResourceType( 4289): For resource 0x0101053c, entry index(1340) is beyond type entryCount(1320)


BUILD SUCCESSFUL in 1m 10s

Why does the app run in Debug mode, but not when installed with the apk?

1

1 Answers

0
votes

I also had this problem, then I connected the device to the Mac, checked the Log on androidSudio, and found the problem. Is the redefinition in the jsBundle file, and finally I found that the method in a js file is repeated, and then it can be packaged normally. You can try.