我使用 React Native 创建了一个应用程序,并且正在尝试生成 apk。完成文档中的所有操作后http://facebook.github.io/react-native/docs/signed-apk-android.html#content http://facebook.github.io/react-native/docs/signed-apk-android.html#content。发生错误,它说
无法读取脚本react-native\react.gradle',因为它不存在。
这是错误
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\User\Desktop\Aaa\android\app\build.gradle' line: 68
* What went wrong:
A problem occurred evaluating project ':app'.
> Could not read script 'C
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
转到项目的根文件夹并运行npm install
它将生成必要的文件,包括react.gradle
如果您没有node.js,可以从这里下载:https://nodejs.org/en/download/ https://nodejs.org/en/download/
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)