组装发布版本的本机应用程序在启动时崩溃

时间:2019-03-18 06:51:47

标签: react-native apk deprecated

我正在使用的应用程序的调试版本有效。但是,当我为其构建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构建一些fittingjni 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无法删除库     '/用户/ someguy /项目/第三/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libgifimage.so'     由于缺少ABI'ARMEABI'的剥离工具。打包原样。     无法删除资料库     '/用户/ someguy /项目/第三/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libicu_common.so'     由于缺少ABI'ARMEABI'的剥离工具。打包原样。     无法删除资料库     '/用户/ someguy /项目/第三/some-app/android/app/build/intermediates/transforms/mergeJniLibs/debug/0/lib/armeabi/libimagepipeline.so'     由于缺少ABI'ARMEABI'的剥离工具。照原样包装。

         

任务:app:installDebug 03:46:57 V / ddms:执行:运行am get-config 03:46:57 V / ddms:在'randonnumber'上执行'am get-config'     :EOF命中。阅读:-1 03:46:57 V / ddms:执行:返回安装APK     适用于app:debug 03:46:57的'SM-G950N-8.0.0'上的'app-debug.apk'     D / app-debug.apk:将app-debug.apk上传到设备“ randonnumber”上     03:46:57 D /设备:将文件上传到设备“ randonnumber”上03:46:57     D / ddms:读取文件的权限     /Users/someguy/projects/third/some-app/android/app/build/outputs/apk/debug/app-debug.apk     如: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”“在'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:执行     'randonnumber'上的'rm“ /data/local/tmp/app-debug.apk”':EOF命中。     阅读:-1 03:47:13 V / ddms:执行:返回已安装在1台设备上。

  
     

在29秒内成功完成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:unchecked以获得详细信息。

> 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:unchecked以获得详细信息。

> 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:deprecation重新编译。

> 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:deprecation重新编译。

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

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

> 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'的剥离工具。打包原样。       无法剥离库'/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'   由于缺少ABI'ARMEABI'的剥离工具。照原样包装。

这些警告出现后。我收到以下消息:

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一起安装却不能运行?

1 个答案:

答案 0 :(得分:0)

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