0

I have a very strange phenomenon with React-Native. I have been working with the iOS simulator mainly but wanted to test my code on my Android phone, a Huawei Nexus 6P. Even after removing the old app from the 6P an older version of my code is run. Yes, I have updated index.android.js to match index.ios.js and, to prove it should work, a Genymotion simulator of the 6P runs the correct code.

I even tested a Kotlin Android project I'm building and when I ran that on my 6P any updates to the code were shown as expected.

I will also mention, though it's probably not relevant, I recently (before this problem) had a separate issue that lead me to run sudo ./gradlew clean after CDing into the Android folder of my project as described in this answer. That didn't fix my issue but I wonder has it somehow 'corrupted' Gradle for my project? Is there a way I can 're-init' or something?

I'm really struggling to understand what could be wrong here, especially since the simulator is updated correctly. Any help is welcome!

UPDATE:

After a helpful tip to clear the cache of the app from bennygenel I did the following and reran react-native run-android but sadly I still have the same problem:

  1. Cleared Cache for the App
  2. Cleared the Data
  3. Force Stopped the App
  4. Uninstalled the App

This is very odd indeed!

Dave Chambers
  • 2,483
  • 2
  • 32
  • 55
  • Can you try wiping data of the emulator and then re-installing the app. – bennygenel Oct 18 '17 at 08:42
  • @bennygenel Thanks but the emulator isn't the problem. The problem is my actual physical `Nexus 6P` :-( – Dave Chambers Oct 18 '17 at 08:45
  • Oh I'm sorry. I got it all wrong. Did you try to clean cache of the app? Also you are not getting any errors while installing right? – bennygenel Oct 18 '17 at 08:46
  • @bennygenel Not yet but that's a good idea. I'll try now. There were no errors, just code from some time ago. I restarted the phone too but that didn't help. – Dave Chambers Oct 18 '17 at 08:48
  • @bennygenel Good idea but I STILL get the old version of the app. I really can't explain this!! – Dave Chambers Oct 18 '17 at 08:58
  • can you try running `watchman watch-del-all && yarn start -- --reset-cache` and then `react-native run-android` on a separate terminal window – bennygenel Oct 18 '17 at 09:02
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/156985/discussion-between-dave-chambers-and-bennygenel). – Dave Chambers Oct 18 '17 at 09:02

0 Answers0