android - react native Android : Generating Signed APK through Android Studio doesn't include JS Bundle

标签 android android-studio reactjs react-native

通过 Android Studio 生成签名 APK 不包含 JS Bundle。 我一直在努力在无法正常工作的设备上安装发布版本。最后我启用了发布版本的调试,我发现通过 android studio 生成的签名 apk 不包含 js 包。

如何生成包含 js 包的签名 apk?上传到 Play 商店。

最佳答案

我在 RN 文档中找到它:

Creating a release build in Android Studio You can use Android Studio to create your release builds too! It’s as easy as creating release builds of your previously-existing native Android app. There’s just one additional step, which you’ll have to do before every release build. You need to execute the following to create a React Native bundle, which’ll be included with your native Android app:

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/com/your-company-name/app-package-name/src/main/assets/index.android.bundle --assets-dest android/com/your-company-name/app-package-name/src/main/res/

Now just create a release build of your native app from within Android Studio as usual and you should be good to go!

关于android - react native Android : Generating Signed APK through Android Studio doesn't include JS Bundle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41057231/

相关文章:

android - 如何进入 ListView 对话框

java - OpenGL ES 2.0 不绘制任何东西

javascript - React useRef 当前不是每次都更新

reactjs - 使用angerouslySetInnerHTML 向页面呈现服务器响应而不进行清理是否明智?

java - 使用 DiskLruCache 时出现正则表达式错误 (Jake Wharton)

java - 数组删除首先从较低的索引开始?

java - React Native,调试 native 库?

android - 批量重命名文件 - Android Studio

android - 构建版本 : Version code not found in manifest

javascript - 如何从子组件调用父组件中的方法?