gpt4 book ai didi

android - 将 gradle 构建工具版本升级到 3.2.1 后,React Native 签名的 apk 失败

转载 作者:行者123 更新时间:2023-11-30 05:12:50 26 4
gpt4 key购买 nike

升级后在build.gradle文件中加入以下行

类路径 'com.android.tools.build:gradle:3.2.1'

gradle-wrapper.properties 文件中的下一行

distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

我的应用程序的签名版本 apk 根本无法运行。虽然当我在开发模式下运行应用程序时一切正常。

下面是我在 android studio logcat 中遇到的错误 -

2018-11-23 17:49:24.552 3506-3570/? E/AndroidRuntime: FATAL EXCEPTION: Thread-2 Process: com.simplydatanow.driverapp, PID: 3506 java.lang.RuntimeException: Unable to load script from assets 'index.android.bundle'. Make sure your bundle is packaged correctly or you're running a packager server. at com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(Native Method) at com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:216) at com.facebook.react.bridge.JSBundleLoader$1.loadScript(JSBundleLoader.java:33) at com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:234) at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1137) at com.facebook.react.ReactInstanceManager.access$900(ReactInstanceManager.java:113) at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:944) at java.lang.Thread.run(Thread.java:764)

这是已签名的发布 apk,因此 index.android.bundle 应该已经存在于 apk 中。但不知何故,它无法找到它。感谢您的帮助。

package.json 中的所有依赖 -

"dependencies": {
"moment": "^2.22.2",
"polished": "^1.9.2",
"react": "16.2.0",
"react-native": "0.52.0",
"react-native-auth0": "^1.2.2",
"react-native-background-fetch": "^2.4.3",
"react-native-background-task": "^0.2.1",
"react-native-compress-image": "^2.0.1",
"react-native-datepicker": "^1.7.2",
"react-native-document-picker": "^2.1.0",
"react-native-elements": "^0.19.0",
"react-native-fab": "^1.0.8",
"react-native-fetch-blob": "^0.10.8",
"react-native-floating-action": "^1.13.0",
"react-native-fs": "^2.10.14",
"react-native-image-cache-hoc": "^2.0.0",
"react-native-image-picker": "^0.26.10",
"react-native-image-progress": "^1.1.0",
"react-native-image-to-pdf": "^1.0.0",
"react-native-image-zoom-viewer": "^2.2.24",
"react-native-keyboard-aware-scroll-view": "^0.5.0",
"react-native-keyboard-aware-view": "^0.0.14",
"react-native-pdf": "^5.0.9",
"react-native-progress": "^3.4.0",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-simple-dialogs": "^0.4.1",
"react-native-star-rating": "^1.0.8",
"react-native-timer-component": "^1.0.2",
"react-native-uuid-generator": "^4.0.1",
"react-native-vector-icons": "^4.6.0",
"react-navigation": "^2.14.2",
"react-redux": "^5.0.7",
"redux": "^3.7.2"

},

最佳答案

在build.gradle(Module:app)中修改版本号和版本名

转到 Build-->Generate Signed Bundle or Apk--> 选择 APK--> 单击“Next”--> 输入 keystore 凭据,或者如果你没有创建它--> 检查 V1 和 V2在签名版本中 --> 单击完成以生成签名的 APK。

将此 APK 上传到 playstore

关于android - 将 gradle 构建工具版本升级到 3.2.1 后,React Native 签名的 apk 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53447051/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com