Skip to content Skip to sidebar Skip to footer

React-native Cannot Find Symbol After Upgrade To 0.60

I try to upgrade my react-native app 0.59.4 to 0.60.0. I use this link as reference to upgrade all native files. But when I try to run my app on an Android device, I've got this er

Solution 1:

I actually missed a few tiny things when using the same page as you did when I migrated from 0.59.10 to 0.60.0.

One of the things I missed (which I could pinpoint was the problem in my case eventually) was that this section had to be added in the bottom of /android/app/build.gradle:

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

I only had the similar line it in /android/settings.gradle but missed that one.


There are other reasons why this might be happening too. Following are GitHub issues I found while trying to fix my project:

  • https://github.com/facebook/react-native/issues/9296: Clear the IDE caches and restart; didn't apply in my case but might do in yours.
  • https://github.com/facebook/react-native/issues/22033 Two solutions proposed:

    1. Make sure maven { url("$rootDir/../node_modules/react-native/android") } is in your allProjects.repositories in /android/build.gradle

    2. Explicitly set your react-native dependency to the version you use. So in /android/app/build.gradle in the dependencies section, you should find an entry compile "com.facebook.react:react-native:+. You can change that to compile "com.facebook.react:react-native:0.60.0. In some cases gradle used an old version of the library because it was referenced by some JavaScript dependency. This change should override that.

Post a Comment for "React-native Cannot Find Symbol After Upgrade To 0.60"