当前位置: 首页 > 知识库问答 >
问题:

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

陆宏扬
2023-03-14

我正在开发的应用程序的调试版本有效。然而,当我为它构建apk时,当我试图启动它时,应用程序立即崩溃。

以下是安装调试版本时收到的信息/消息:

任务:react-native-picker:compiledebugjavawithjavac注意:/users/someguy/projects/third/some-app/node_modules/react-native-picker/android/src/main/java/com/beefe/picker/pickerViewModule。注意:详细信息请使用-xlint:deprecation重新编译。

任务:app:compiledebugjavawithjavac注意:/users/someguy/projects/third/some-app/android/app/src/main/java/com/someapp/tone/tone.Java使用或重写了一个不推荐的API。注意:详细信息请使用-xlint:deprecation重新编译。注意:/users/someguy/projects/third/some-app/android/app/src/main/java/com/someapp/fitting/ovfitting.java使用未经检查或不安全的操作。注意:使用-xlint重新编译:未选中详细信息。

任务:应用程序:ExternalNativeBuildDebug构建somefittingjni x86[1/2]构建CXX对象cmakefiles/somefittingjni.dir/src/main/cpp/somefittingjni.cpp.o[2/2]链接CXX共享库../../../../../Build/mediates/cmake/debug/Build/mediates/cmake/debug/Build/mediates/cmake/debug/x86/libsomeFittingJNI.so构建meabi-v7a/libsomefittingjni.so

任务:app:TransformNativelibswithStripDebugSymbolforDebug无法剥离库'/users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergejnilibs/debug/0/lib/armeabi/libgiffimage.so',因为缺少ABI'armeabi'的剥离工具。原样包装。无法剥离库'/users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergejnilibs/debug/0/lib/armeabi/libicu_common.so',因为缺少ABI'armeabi'的剥离工具。原样包装。无法剥离库“/users/someguy/projects/third/some-app/android/app/build/intermediates/transforms/mergejnilibs/debug/0/lib/armeabi/libimagePipeline.so”,因为缺少ABI“armeabi”的剥离工具。原样包装。

任务: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。阅读:-1 03:46:57 V/ddms:执行:返回在'SM-G950N-8.0.0'上安装APK'app-debug.APK'的app:debug 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/some-app/android/app/build/outputs/APK/debug/app-debug.APK data/local/tmp/app-debug.APK“03:47:13 v/ddms:在”randonnumber“上执行'pm install-r-t”/data/local/tmp/app-debug.APK“:EOF命中。阅读:-1 03:47:13 v/ddms:execute:returning 03:47:13 v/ddms:execute:run rm“/data/local/tmp/app-debug.apk”03:47:13 v/ddms:execute'rm“/data/local/tmp/app-debug.apk”on'randonnumber':EOF hit。阅读:-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
> 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
> 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
> Task :app:compileReleaseJavaWithJavac 
Note: /Users/someguy/projects/third/someapp/android/app/src/main/java/com/someapp/tone/Tone.java
> 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个答案

红富
2023-03-14

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

 类似资料:
  • 我对react原生版APK有一个问题。

  • 问题是,当我在Google中使用授权运行此代码时,它会立即崩溃: 但是日志中的错误: 2019-06-22 17:55:42.652 29327-23222/?E/AudioSource:在已关闭的AudioSource 2019-06-22 17:55:43.240 2093-2616/?E/TouchFilter:setTouchFilter日志启用参数:0 2019-06-22 17:55:

  • 我已经尝试过几次升级flutter,但似乎也没有任何问题: 我最近换了笔记本电脑,并在这个新的笔记本上查看了我的代码的git存储库。有一些问题,但我最终解决了这些问题。唯一的区别是项目名称现在只是,而包名称是-但我认为这不会造成任何问题。 我的猜测是,问题出在我的中的某个地方:

  • 我想生成未签名的应用程序版本.apk没有反应打包服务器。为此,我正在运行以下命令。 cd react-native-project-dir react-原生捆绑-平台android-dev false-入口文件index.android.js-捆绑输出android/app/src/main/资产/index.android.bundle-资产-最棒的android/app/src/main/re

  • null 在上面,“开始”的意思是做 任一 React-Native Run-Android 光盘android&&./Gradlew Assemblerelease 光盘.. react-native run-android--variant=release null ... ... package.json... Android/app/build.gradle

  • 我正在尝试使用接收推送通知。正如文件所述,我正在安装并实施以下所有步骤 a) 安装react-native fcm b)使用链接库 c) 下载文件,从firebase控制台将其放入/ios/my project目录中 d)使用Cocoapods 1. cd ios安装Firebase消息传递 e)编辑 f) 编辑AppDelegate。m g) 启用功能 推送通知 背景模式 然后我将我的应用程序归