assembleRelease版本的react-native应用程序在启动时崩溃

问题描述 投票:1回答:1

我正在努力的应用程序的调试版本工作。但是,当我为它构建一个apk时,应用程序在我尝试启动它后立即崩溃。

这是我安装调试版时收到的信息/消息:

任务:react-native-fbsdk:compileDebugJavaWithJavac注意:某些输入文件使用或覆盖已弃用的API。注意:使用-Xlint重新编译:弃用以获取详细信息。注意:/Users/someguy/projects/third/some-app/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java使用未经检查或不安全的操作。注意:使用-Xlint重新编译:取消选中以获取详细信息。

任务:react-native-google-analytics-bridge:compileDebugJavaWithJavac注意:/ Users / someguy / projects / third / some-app / node_modules / react-native-google-analytics-bridge / android / src / main / java / com / idehub / GoogleAnalyticsBridge / ConvertToWritable.java使用未经检查或不安全的操作。注意:使用-Xlint重新编译:取消选中以获取详细信息。

任务:react-native-i18n:compileDebugJavaWithJavac注意:/Users/someguy/projects/third/some-app/node_modules/react-native-i18n/android/src/main/java/com/AlexanderZaytsev/RNI18n/RNI18nModule.java使用或覆盖已弃用的API。注意:使用-Xlint重新编译:弃用以获取详细信息。

任务:react-native-picker:compileDebugJavaWithJavac注意:/Users/someguy/projects/third/some-app/node_modules/react-native-picker/android/src/main/java/com/beefe/picker/PickerViewModule.java使用或覆盖已弃用的API。注意:使用-Xlint重新编译:弃用以获取详细信息。

任务:app:compileDebugJavaWithJavac注意:/Users/someguy/projects/third/some-app/android/app/src/main/java/com/someapp/tone/Tone.java使用或覆盖不推荐使用的API。注意:使用-Xlint重新编译:弃用以获取详细信息。注意:/Users/someguy/projects/third/some-app/android/app/src/main/java/com/someapp/fitting/OVFitting.java使用未经检查或不安全的操作。注意:使用-Xlint重新编译:取消选中以获取详细信息。

任务:app:externalNativeBuildDebug构建somefittingjni x86 [1/2]构建CXX对象CMakeFiles / somefittingjni.dir / src / main / cpp / somefittingjni.cpp.o [2/2]链接CXX共享库../../ .. /../build/intermediates/cmake/debug/obj/x86/libsomefittingjni.so构建somefittingjni armeabi-v7a [1/2]构建CXX对象CMakeFiles / somefittingjni.dir / src / main / cpp / somefittingjni.cpp.o [ 2/2]链接CXX共享库../../../../build/intermediates/cmake/debug/obj/armeabi-v7a/libsomefittingjni.so

任务:app:transformNativeLibsWithStripDebugSymbolForDebug由于缺失而无法剥离库'/Users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libgifimage.so' ABI'ARMEABI'的剥离工具。按原样包装。由于缺少ABI的剥离工具,无法剥离库'/Users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libicu_common.so' ARMEABI”。按原样包装。由于缺少ABI的剥离工具,无法剥离库'/Users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libimagepipeline.so' ARMEABI”。按原样包装。

任务:app:installDebug 03:46:57 V / ddms:执行:running am get-config 03:46:57 V / ddms:在'randonnumber'上执行'am get-config':EOF命中。阅读:-1 03:46:57 V / ddms:执行:返回在'SM-G950N - 8.0.0'上为app安装APK'app-debug.apk':调试03:46:57 D / app-debug。 apk:上传app-debug.apk到设备'randonnumber'03:46:57 D /设备:上传文件到设备'randonnumber'03:46:57 D / ddms:读取/ users / someguy / projects / third的文件permision /some-app/android/app/build/outputs/apk/debug/app-debug.apk as:rw -r - r-- 03:46:59 V / ddms:执行:运行pm install -r -t “/data/local/tmp/app-debug.apk”03:47:13 V / ddms:执行'pm install -r -t“/data/local/tmp/app-debug.apk”'on'randonnumber' :EOF命中。阅读:-1 03:47:13 V / ddms:执行:返回03:47:13 V / ddms:执行:运行rm“/data/local/tmp/app-debug.apk”03:47:13 V / ddms:执行'rm“/data/local/tmp/app-debug.apk”'on'randonnumber':EOF命中。阅读:-1 03:47:13 V / ddms:执行:返回安装在1个设备上。

在29s内成功完成265个可操作的任务:250个执行,15个最新

创建apk时,我收到以下警告,但仍然会创建apk:

> 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

使用未经检查或不安全的操作。注意:使用-Xlint重新编译:取消选中以获取详细信息。

> 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

使用未经检查或不安全的操作。注意:使用-Xlint重新编译:取消选中以获取详细信息。

> 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

使用或覆盖已弃用的API。注意:使用-Xlint重新编译:弃用以获取详细信息。

> 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

使用或覆盖已弃用的API。注意:使用-Xlint重新编译:弃用以获取详细信息。

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

使用或覆盖已弃用的API。注意:使用-Xlint重新编译:弃用以获取详细信息。注意:/Users/someguy/projects/third/someapp/android/app/src/main/java/com/someapp/fitting/OVFitting.java使用未经检查或不安全的操作。注意:使用-Xlint重新编译:取消选中以获取详细信息。

> 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'

由于缺少ABI'ARMEABI'的剥离工具。按原样包装。由于缺少ABI'ARMEABI'的剥离工具,无法剥离库'/Users/someguy/projects/third/someapp/android/app/build/intermediates/transforms/mergeJniLibs/release/0/lib/armeabi/libicu_common.so' 。按原样包装。由于缺少ABI'ARMEABI'的剥离工具,无法剥离库'/Users/someguy/projects/third/someapp/android/app/build/intermediates/transforms/mergeJniLibs/release/0/lib/armeabi/libimagepipeline.so' 。按原样包装。

在那些警告出现之后。我收到以下消息:

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

为什么应用程序在调试模式下运行,但在与apk一起安装时却没有?

react-native apk deprecated
1个回答
0
投票

我也有这个问题,然后我将设备连接到Mac,检查登录androidSudio,发现问题。是jsBundle文件中的重新定义,最后我发现重复了js文件中的方法,然后可以正常打包。你可以试试。

© www.soinside.com 2019 - 2024. All rights reserved.