+-
我想构建未签名的apk或调试apk.我的应用程序已在本地主机上成功运行.我尝试了不同的方法.但是它显示了错误.我从 Here得到了答案.应用命令时


react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug
它显示错误是
Cannot find entry file index.android.js in any of the roots: ["D:\\workspace\\reactjs\\native\\myapp5"]
然后我将index.android.js更改为App.js
然后它将显示错误是
ENOENT: no such file or directory, open 'D:\workspace\reactjs\native\myapp5\android\app\build\intermediates\assets\debug\index.android.bundle'
如何解决这个问题呢?请帮我.
我的react native版本是react-native-cli:2.0.1,react-native:0.52.0.我发布的根文件夹的屏幕快照.
当我在android文件夹中运行gradlew assembleDebug时,显示错误.
最佳答案
这里的问题是您似乎没有为反应本机包指定的入口文件:
index.android.js
根据项目结构,将其替换为项目的入口文件index.js或app.js.
更新:
react-native bundle --dev false --platform android --entry-file <your-entry-file> --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug
创建调试版本:
cd android && ./gradlew assembleDebug
您的apk将位于android / app / build / outputs / apk
点击查看更多相关文章
转载注明原文:android-如何在React Native中构建调试APK - 乐贴网