react-native: error: method does not override or implement a method from a supertype @Override

Environment

After running react-native info i got Unrecognized command 'info' .

Steps to Reproduce

run react-native run-android

Expected Behavior

Should compile android

Actual Behavior

This morning I got this error after running react-native run-android I got this error


node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBSDKPackage.java:61: error: method does not override or implement a method from a supertype
    @Override
    ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/manuela/robonica/roboapp/node_modules/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/Utility.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
:react-native-fbsdk:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-fbsdk:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 22.481 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html 

I’m getting this error with a lot of libraries, so the problem is not just this library, but something changes on React-native i think.

Also I notice this

Download https://jcenter.bintray.com/com/facebook/react/react-native/0.55.3/react-native-0.55.3.pom
Download https://jcenter.bintray.com/com/facebook/fresco/fresco/1.3.0/fresco-1.3.0.pom
Download https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.3.0/imagepipeline-okhttp3-1.3.0.pom
Download https://jcenter.bintray.com/com/facebook/fresco/drawee/1.3.0/drawee-1.3.0.pom
Download https://jcenter.bintray.com/com/facebook/fresco/fbcore/1.3.0/fbcore-1.3.0.pom
Download https://jcenter.bintray.com/com/facebook/fresco/imagepipeline/1.3.0/imagepipeline-1.3.0.pom
Download https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-base/1.3.0/imagepipeline-base-1.3.0.pom
Download https://jcenter.bintray.com/com/facebook/fresco/fbcore/1.3.0/fbcore-1.3.0.aar
Download https://jcenter.bintray.com/com/facebook/fresco/drawee/1.3.0/drawee-1.3.0.aar
Download https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-base/1.3.0/imagepipeline-base-1.3.0.aar
Download https://jcenter.bintray.com/com/facebook/fresco/imagepipeline/1.3.0/imagepipeline-1.3.0.aar
Download https://jcenter.bintray.com/com/facebook/fresco/fresco/1.3.0/fresco-1.3.0.aar
Download https://jcenter.bintray.com/com/facebook/fresco/imagepipeline-okhttp3/1.3.0/imagepipeline-okhttp3-1.3.0.aar
Download https://jcenter.bintray.com/com/facebook/react/react-native/0.55.3/react-native-0.55.3.aar
Incremental java compilation is an incubating feature.
Could not find google-services.json while looking in [src/nullnull/debug, src/debug/nullnull, src/nullnull, src/debug, src/nullnullDebug]
Could not find google-services.json while looking in [src/nullnull/release, src/release/nullnull, src/nullnull, src/release, src/nullnullRelease]

Why is downloading react-native 0.55.3 pom files?

Thx

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 19

Most upvoted comments

In our case react-native-audio plugin brought 0.55.3 dependency and caused this havoc.

Here is how we locked down our RN version across all modules. Edit the android/build.gradle file and make the following changes:

allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url "$rootDir/../node_modules/react-native/android"
        }
        configurations.all {
          resolutionStrategy {
            // START: RN version lockdown 
            force 'com.facebook.react:react-native:0.45.1'   //Your RN version should go here
            // END: RN version lockdown 
          }
        }
    }
}

Hey, I figured out how to lock down transitive dependencies for such projects. Add this to root youappname.gradle file. Don’t forget to change the version.

subprojects {
    configurations.all {
        resolutionStrategy {
            force 'com.facebook.react:react-native:0.46.4'
        }
    }
}

These fixes don’t seem to be working for me anymore:

subprojects {
    configurations.all {
        resolutionStrategy {
            force 'com.facebook.react:react-native:0.46.4'
        }
    }
}

or

compile ("com.facebook.react:react-native:0.44.2") { force = true }

I get the following error:

Could not find com.facebook.react:react-native:0.44.2

Can be put a priority 1 on this issue.

yarn add react-native Fixed this issue for me!😃

[EDIT] @kelset commented exactly the same as I am explaining below in bug #19259 [EDIT]

First of all I’m sorry but English is not my native language. I think I’ve found what’s causing this problem.

The problem is occurring because react-native has been updated at http://jcenter.bintray.com/com/facebook/react/react-native/. This update was published on 2018-05-15 08:41:47 as can be seen in the image below.

screen shot 2018-05-16 at 01 56 53

Due to this update the project no longer uses the version contained in the ‘node_modules’ folder and uses the last version existing in the site.

The strange thing is that the ‘0.49.5’ and ‘0.55.3’ versions are listed at http://jcenter.bintray.com/com/facebook/react/react-native/ but are not listed in https://bintray.com/bintray/jcenter/com.facebook.react:react-native. Is this right?

screen shot 2018-05-16 at 02 08 29

@thebergamo You have to lock down RN version for every affected package, not just your app. I got 5 of them on current project. Ideally every package has to read RN version from gradle.properties. Is there a better solution?

The solution in this issue solves the problem: https://github.com/facebook/react-native/issues/19259