Anuj Sharma
Anuj Sharma

Reputation: 457

Build react native app to apk file after making new changes?

I build a react native app with this documentation , its working fine then , But when i am implementing new changes to apk , its not installing properly on my android Mobile device and gives error on first open , please help .a

Upvotes: 1

Views: 3355

Answers (2)

Suyash
Suyash

Reputation: 65

I was also facing the same issues and I had tried

cd android && ./gradlew clean && ./gradlew assembleDebug

and It was not working for me

then I tried running at root

yarn createDebug

and checked apk at

root/android/app/build/outputs/apk/debug/app-debug.apk

It worked for me

Upvotes: -1

Gaurav Roy
Gaurav Roy

Reputation: 12195

To make the new changes first bundle your js file, and then after that either you can create a debug APK whihc needs a development server or build a release apk which doesnt require.

  1. in your main app directory paste this

updated:

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

2.to build debug apk ,

go to android directory , and then ./gradlew assembleDebug

or for release apk ,

go to android directory , and then ./gradlew assembleRelease

Hope it helps .feel free for doubts

Upvotes: 4

Related Questions