Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React native is stuck at old version app

Tags:

react-native

When I run react-native run-android it only installs the old version of the app in simulator and changes are not shown.

Any suggestion is appreciated.

like image 210
Amin Avatar asked Jul 13 '17 08:07

Amin


People also ask

How do you run release build in iOS React Native?

To configure your app to be built using the Release scheme, go to Product → Scheme → Edit Scheme. Select the Run tab in the sidebar, then set the Build Configuration dropdown to Release .

Why shouldn't you use React Native?

The number one drawback to React Native is performance. It is better than other hybrid tools and web apps, but there's no getting around the large overhead framework that slows down performance when measured against native apps.

Why is React Native slow on Android?

Slow app launch is another issue of React Native apps. If your app opens too slowly, you probably have too many dependencies in your app and you're using slow components. Try to use fast, high-performance components and decrease the number of dependencies in your app.


2 Answers

Tried with the solutions above, not sure if they helped for the final version, but what worked at the end was running ./gradlew clean assembleRelease in the /android folder.

like image 139
dblazeski Avatar answered Oct 06 '22 19:10

dblazeski


Seems like we have to re-bundle assets every time we compile it to android app. This worked for me:

  1. First run this:

    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. Then this:

    react-native run-android
    
like image 33
Hashir Baig Avatar answered Oct 06 '22 20:10

Hashir Baig