[V2][Android] cannot find symbol import com.facebook.react.bridge.NativeDeltaClient
Issue Description
Fresh install with documentation from https://github.com/wix/react-native-navigation/blob/v2/docs/docs/Installing.md gives such errors
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java:3: error: cannot find symbol
import com.facebook.react.bridge.NativeDeltaClient;
^
symbol: class NativeDeltaClient
location: package com.facebook.react.bridge
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java:10: error: cannot find symbol
public void onSuccess(@Nullable NativeDeltaClient nativeDeltaClient) {
^
symbol: class NativeDeltaClient
location: class JsDevReloadHandlerFacade
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/ReloadHandlerFacade.java:3: error: cannot find symbol
import com.facebook.react.bridge.NativeDeltaClient;
^
symbol: class NativeDeltaClient
location: package com.facebook.react.bridge
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/ReloadHandlerFacade.java:10: error: cannot find symbol
public void onSuccess(@Nullable NativeDeltaClient nativeDeltaClient) {
^
symbol: class NativeDeltaClient
location: class ReloadHandlerFacade
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java:3: error: cannot find symbol
import com.facebook.react.bridge.NativeDeltaClient;
^
symbol: class NativeDeltaClient
location: package com.facebook.react.bridge
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java:10: error: cannot find symbol
public void onSuccess(@Nullable NativeDeltaClient nativeDeltaClient) {
^
symbol: class NativeDeltaClient
location: class DevBundleDownloadListenerAdapter
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/JsDevReloadHandlerFacade.java:9: error: method does not override or implement a method from a supertype
@Override
^
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/ReloadHandlerFacade.java:24: error: onSuccess() in ReloadHandlerFacade cannot implement onSuccess() in DevBundleDownloadListener
protected abstract void onSuccess();
^
attempting to assign weaker access privileges; was public
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/ReloadHandlerFacade.java:9: error: method does not override or implement a method from a supertype
@Override
^
/Users/evgenij/Develop/ReactNative/androidwix2/node_modules/react-native-navigation/lib/android/app/src/reactNative56/java/com/reactnativenavigation/react/DevBundleDownloadListenerAdapter.java:9: error: method does not override or implement a method from a supertype
@Override
^
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
10 errors
Environment
- React Native Navigation version: 2.0.2461
- React Native version: 0.56
- Platform(s): Android
- Device info: Simulator, MacOS, Debug
You need to follow the installation instructions correctly, don't forget to ignore the buildVariants that you are not using.
Hey, we're having this issue now when trying to upgrade to RN 0.63 from RN 0.61. We're currently on 6.3.0, but the documentation is only for 6.12.2 and 7. We have followed the installation instructions for 6.12.2, but we still have the same issue.
We have added this:
subprojects { subproject ->
afterEvaluate {
if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
variantFilter { variant ->
def names = variant.flavors*.name
if (
names.contains("reactNative51") ||
names.contains("reactNative55") ||
names.contains("reactNative56") ||
names.contains("reactNative57") ||
names.contains("reactNative57_5") ||
names.contains("reactNative62")
) {
setIgnore(true)
}
}
}
}
}
}
Also tried removing reactNative62 but without luck. Any tips on how to solve this? :)
Exact same issue here.
I solved it by setting the missingDependencyStrategy to reactNative62 which is apparently compatible with react-native 0.63.3 that I'm currently using.
in ./android/app/build.gradle
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
defaultConfig {
applicationId "com.newlinecode.mobie"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative62"
...
}
}
Thanks to @enisinanaj I fixed it on RN 0.64.2 and RNN 7.16.0 (macOS Big Sur - Android Studio 4.2.2):
- in ./android/app/build.gradle
defaultConfig {
applicationId "com.newlinecode.mobie"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative63" // <---
...
}
- in ./android/build.gradle at the end of the file, make sure to remove all react-native variants that you don't use
subprojects { subproject ->
afterEvaluate {
if ((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
android {
variantFilter { variant ->
def names = variant.flavors*.name
if (names.contains("reactNative51") || names.contains("reactNative55") || names.contains("reactNative56") || names.contains("reactNative57") || names.contains("reactNative57_5") || names.contains("reactNative60") || names.contains("reactNative62")) {
setIgnore(true)
}
}
}
}
}
}
- Make sure you have an updated version of Java (JDK - openjdk), mine was 1.8.0 and updated to 11 LTS (also make sure that Android Studio and Terminal are using the same JDK)
EDIT: 09/07/2021: I've removed the missingDimensionStrategy line in android/app/build.gradle and the whole section of subprojects for variants in android/build.gradle and it works fine. This is the best thing to do for future upgrades.
Thanks to @enisinanaj I fixed it on RN 0.64.2 and RNN 7.16.0:
in ./android/app/build.gradle
defaultConfig { applicationId "com.newlinecode.mobie" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion missingDimensionStrategy "RNN.reactNativeVersion", "reactNative63" // <--- ... }
thanks,solved
Hii @enisinanaj , My RN 0.73.4 and RNN 7.37.0 version, how can i fix that issue
@Vishujain1 try adding reactNative71, not sure if this will work for you but if not I guess a google search can yield more results.
defaultConfig {
applicationId "com.newlinecode.mobie"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative71" // <---
...
}
Thank You @enisinanaj , It's working now with reactNative71