So i opened up my project today, ready to export and compile an Android build.
I ran: react-native run-android and ./gradlew bundleRelease" as i always does, but now it errors and fails every time. It's still working on iOS, and no changes have been made to the android part.
Error:
Task :react-native-navigation:compileReactNative68DebugJavaWithJavac FAILED /Users/xxxxxx/Documents/Github/YourProjectName/node_modules/react-native-navigation/lib/android/app/src/reactNative68/java/com/reactnativenavigation/react/NavigationReactNativeHost.java: error: cannot find symbol .setUIImplementationProvider(getUIImplementationProvider())
Anyone know how i can fix this? Been trying literally all answers on SO and GitHub (their repo)
Using Kotlin 1.6 (tried with 1.4.31 also) RN: 0.68.2
Any help is much appreciated!
Edit (solution) Add the following in your android/build.gradle file
exclusiveContent {
// We get React Native's Android binaries exclusively through npm,
// from a local Maven repo inside node_modules/react-native/.
// (The use of exclusiveContent prevents looking elsewhere like Maven Central
// and potentially getting a wrong version.)
filter {
includeGroup "com.facebook.react"
}
forRepository {
maven {
url "$rootDir/../node_modules/react-native/android"
}
}
}
It's all related to https://github.com/facebook/react-native/issues/35210 and this https://github.com/wix/react-native-navigation/issues/7630