升级build.gradle文件中的以下行
classpath '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:致命异常: 线程2 进程:com.simplydatanow.driverapp,PID:3506 java.lang.RuntimeException:无法从资产“ index.android.bundle”加载脚本。确保捆绑包包装正确,或 您正在运行打包服务器。 在com.facebook.react.bridge.CatalystInstanceImpl.jniLoadScriptFromAssets(本机 方法) 在com.facebook.react.bridge.CatalystInstanceImpl.loadScriptFromAssets(CatalystInstanceImpl.java:216) 在com.facebook.react.bridge.JSBundleLoader $ 1.loadScript(JSBundleLoader.java:33) 在com.facebook.react.bridge.CatalystInstanceImpl.runJSBundle(CatalystInstanceImpl.java:234) 在com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1137) 在com.facebook.react.ReactInstanceManager.access $ 900(ReactInstanceManager.java:113) 在com.facebook.react.ReactInstanceManager $ 5.run(ReactInstanceManager.java:944) 在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"
},
答案 0 :(得分:0)
更改build.gradle(Module:app)中的版本代码和版本名称
转到Build->生成签名包或Apk->选择APK->单击'Next'->输入密钥库凭据或如果您没有创建它->检查V1和V2在签名版本中->单击“完成”以生成签名的APK。
将此APK上载到Playstore