简体   繁体   English

React Native Android:通过Android Studio生成签名APK不包括JS Bundle

[英]React Native Android: Generating Signed APK through Android Studio doesn't include JS Bundle

Generating Signed APK through Android Studio doesn't include JS Bundle. 通过Android Studio生成Signed APK不包括JS Bundle。 I have been struggling install the release build on device it was not working. 我一直在努力在无法正常工作的设备上安装发行版本。 finally i enabled the debugging for Release build and i find out that Generated signed apk through android studio doesn't include js bundle. 最后,我启用了Release版本的调试功能,发现通过android studio生成的签名apk不包含js捆绑包。

How can i generate a signed apk including js bundle? 如何生成包含js包的签名apk? to upload to play store. 上载以播放商店。

I found it on RN documentations : 我在RN文档中找到它:

Creating a release build in Android Studio You can use Android Studio to create your release builds too! 在Android Studio中创建发布版本您也可以使用Android Studio创建发布版本! It's as easy as creating release builds of your previously-existing native Android app. 就像创建您以前存在的本机Android应用的发行版本一样简单。 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捆绑包,该捆绑包将包含在您的本机Android应用程序中:

 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 Studio中为您的本机应用程序创建发行版,就可以了!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM