react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

[V2][Android] cannot find symbol import com.facebook.react.bridge.NativeDeltaClient

Open esomkin opened this issue 8 years ago • 9 comments

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

esomkin avatar Aug 08 '18 13:08 esomkin

You need to follow the installation instructions correctly, don't forget to ignore the buildVariants that you are not using.

ItsNoHax avatar Aug 09 '18 11:08 ItsNoHax

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? :)

skeie avatar Sep 28 '20 08:09 skeie

Exact same issue here.

enisinanaj avatar Nov 09 '20 22:11 enisinanaj

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"

        ...
    }
}

enisinanaj avatar Nov 09 '20 23:11 enisinanaj

Thanks to @enisinanaj I fixed it on RN 0.64.2 and RNN 7.16.0 (macOS Big Sur - Android Studio 4.2.2):

  1. in ./android/app/build.gradle
defaultConfig {
        applicationId "com.newlinecode.mobie"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        missingDimensionStrategy "RNN.reactNativeVersion", "reactNative63" // <---

        ...
    }
  1. 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)
                    }
                }
            }
        }
    }
}
  1. 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.

JimTeva avatar Jun 28 '21 07:06 JimTeva

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

Jianlong-Nie avatar Jul 01 '21 02:07 Jianlong-Nie

Hii @enisinanaj , My RN 0.73.4 and RNN 7.37.0 version, how can i fix that issue

Vishujain1 avatar Feb 28 '24 12:02 Vishujain1

@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" // <---

        ...
    }

enisinanaj avatar Feb 28 '24 13:02 enisinanaj

Thank You @enisinanaj , It's working now with reactNative71

Vishujain1 avatar Feb 29 '24 04:02 Vishujain1