score:-1

just try to generate apk from android studio. it is the best and the most stable way. you can find lots of articles about generating apk from android studio.

if you still want to generate apk from command line here is the command to run:

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 && rm -rf android/app/src/main/res/drawable-* && cd android && ./gradlew assemblerelease

if you need a more detailed article: https://www.instamobile.io/android-development/generate-react-native-release-build-android/

score:0

i am new to react-native and i use expo. if you are new to app react-native development, try installing expo and letting them handle the build process.

how to install expo onto existing react-native project: https://jablog.online/blog/2020/01/22/existing-react-native-project-on-expo/

score:0

the problem solved by using ./gradlew assembleerelease command.

score:1

you have to clean the gradle first then run the command ./gradlew bundlerelease otherwise use following command into your project directory.

  1. cd android && ./gradlew clean
  2. cd ..
  3. npx react-native run-android --variant=release

Related Query

More Query from same tag