apk生成文件在React Native Android中带有错误 [英] apk build file come with errors in react native android
问题描述
在这里,我已使用此文档文档
在jenkins
(在虚拟机中)上配置的jenkins
中.
Here, I have built the react native android
app using this documentation Doc
in jenkins
which was configured on ubuntu 16.04
(in virtual machine).
这是我用来在Jenkins中构建react native应用程序(android)的构建命令
Here is the build command which I used to build the react native app(android) in Jenkins
cd $WORKSPACE && chmod -R 777 ./android && cd ./android && npm install && ./gradlew clean && ./gradlew assembleDebug
构建过程结束,在以下路径中成功创建了apk
文件
build_release_v1/ws/android/app/build/outputs/apk/
The build process end successfully creating an apk
file in the following path
build_release_v1/ws/android/app/build/outputs/apk/
注意 build_release_v1
是jenkins项目名称,而ws
是其工作区.
Note build_release_v1
is the jenkins project name and ws
is for the workspace of it.
尽管创建了apk
,但出现以下错误
Though the apk
is created it comes up with following errors
可能是什么情况....请帮助我...提前感谢...
What may be the case ....please help me with this ...Thanks in advance...
推荐答案
问题是,如果您想要调试版本(因为您使用的是assembleDebug
),React Native会生成一个APK,该APK预期与捆绑服务器(与react-native run-android
相同).我的猜测是,您要在没有捆绑程序的情况下测试该应用程序,因此有两种选择:要么运行assembleRelease
,要么(运行此问题.
The problem is that if you want a debug build (since you are using assembleDebug
), React Native generates an APK that expects to have a connection to the bundle server (it does the same as react-native run-android
). My guess is that you want to test the app without the bundler, so you have two options: either run assembleRelease
instead (have a look here for more details) or manually create the bundled JavaScript code and then create the APK. Please refer to this question for details.
这篇关于apk生成文件在React Native Android中带有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!