Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.1k views
in Technique[技术] by (71.8m points)

android bundle - Process 'command 'npx.cmd'' finished with non-zero exit value 1 React native build problem

I am working on react native. When i try to create a build of android using

gradlew assembleRelease

then getting an

* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> Process 'command 'npx.cmd'' finished with non-zero exit value 1

But when i create a build using below command build succesfully build

gradlew assembleRelease -x bundleReleaseJsAndAssets 

But build not run on mobile device as i am opening my app after install it just crashed.

Also when i try to create build on different System (8gm ram) with same code then it creates build with same command and the build will successfully created. Provide me a solution for this,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

For me, I had to run npm run android once and then ./gradlew assembleRelease worked

UPDATE: Run following command and see output log to find the bug

npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...