对不起我的英语,这是我的第一期
嗨,我创建了一个问题 https://github.com/facebook/react-native/issues/4124
我可以运行完美的 react-native start/react-native run-android 并且效果很好
- 所以:Windows 10
- 节点:4.2.2
- npm:2.14.7
- native react :0.1.7
我完全准确地遵循了本教程https://facebook.github.io/react-native/docs/signed-apk-android.html#content
1-关键性别[ok]
2- 编辑文件 ~/.gradle/gradle.properties [确定]
3- 将签名配置添加到应用的 gradle 配置 (android/app/build.gradle)
启动命令./gradlew assembleRelease
报错如下
没有找到命令 native react
然后我们改变绝对路径
// set up the call to the react-native cli
workingDir reactRoot
commandLine "C:/Users/yo/AppData/Roaming/npm/react-native.cmd", "bundle", "--platform", "android", "--dev", "false", "--entry-file",
entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease
在这种情况下,它失败了。是无限加载
:app:prepareComFacebookReactReactNative0140Library UP-TO-DATE
:app:prepareComGoogleAndroidExoplayerExoplayerR151Library UP-TO-DATE
:app:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:app:prepareReleaseDependencies
:app:compileReleaseAidl UP-TO-DATE
:app:compileReleaseRenderscript UP-TO-DATE
:app:generateReleaseBuildConfig UP-TO-DATE
:app:generateReleaseAssets UP-TO-DATE
:app:mergeReleaseAssets UP-TO-DATE
:app:generateReleaseResValues UP-TO-DATE
:app:generateReleaseResources UP-TO-DATE
:app:mergeReleaseResources UP-TO-DATE
> Building 79% > :app:bundleReleaseJsAndAssets
不带 key 文件测试(完全一样)
在测试了几个命令之后。
./gradlew --info assembleRelease
如果我在最后等待很长时间,我会得到一个错误
最佳答案
通过使用 -g npm install -g react-native-cli
运行安装命令,确保全局安装 react-native
关于android - windows 生成签名 APK 不工作 [react-native],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33748210/