Update:

  • I have found a workaround. One of the (many) packages that I am using in the app is react-native-device-info. If I don't call it from within the app, the problem is gone (even if the app is still included in the build)
  • When I tried to get the app's version number by accessing Platform.constants.Release, the problem occurs again.

The question: long story... I will try to make it short:

  • My react-native app was running with RN 0.59.9
  • I have upgraded RN to 0.62.2, and it is running with this version, too
  • The app on android, however, became much slower
  • I have two ways to try and resolve this: go back to RN 0.59.9, or use Hermes in 0.62.2
  • The hermes build fails (different story), so I checked out the branch that worked with 0.59.9 and copied over the new application files from 0.62.2
  • I got some errors indicating that application files are using packages that are not in my build (added after upgrading to 0.62.2), fixed them
  • Now I am getting the following error in metro bundler:

::ffff:127.0.0.1 - - [18/Oct/2020:09:21:04 +0000] "GET <class-module-name"> <HTTP/1.1" 404 208 "-" "okhttp/3.12.1"

  • I am getting it for the App.js file that is referenced from index.js, and for the first module that is imported in App.js. The strange thing is that the bundler reported errors for these modules, so it accessed them already...

  • Any idea?

(I have read all the relevant github and stack overflow issues/questions mentioning a similar error. None solved my problem).

1

There are 1 answers

2
Ken Lee On

Since you have upgraded RN, and then downgraded back, and then copied over files from different versions/branches, I would strongly recommend you to clear the cache when compiling:

To clear your cache:

react-native start --reset-cache

If you are using expo-cli, then use:

expo start -c