Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: method does not override or implement a method from a supertype @Override #19272

Closed
3 tasks done
manuTro opened this issue May 15, 2018 · 19 comments
Closed
3 tasks done
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@manuTro
Copy link

manuTro commented May 15, 2018

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

@guerjon
Copy link

guerjon commented May 15, 2018

I got this same error, but with a different library BLE (https://github.com/innoveit/react-native-ble-manager) also with the 0.44 Version on Android.

@thebergamo
Copy link

thebergamo commented May 15, 2018

The solution in this issue solves the problem: #19259

@fearmear
Copy link

fearmear commented May 15, 2018

@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?

@guerjon
Copy link

guerjon commented May 15, 2018

@fearmear You Right, The update React-Native 0.55.3 is broken, and by every library that you install with npm install "some-react-native-library" is broken if the "some-react-native-library" use the last version of react-native (you can check this if in the app/build.gradlew has compile 'com.facebook.react:react-native:+' ) you must change every library to you current version of react-native, and this can introduce new problems.

@fearmear
Copy link

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'
        }
    }
}

@ray-shawn
Copy link

@fearmear Save me after adding to build.gradle

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

@jqn
Copy link

jqn commented May 16, 2018

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.

@FernandoWahl
Copy link

FernandoWahl commented May 16, 2018

[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

@Mahaswami
Copy link

Mahaswami commented May 16, 2018

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 
          }
        }
    }
}

@nkchouhan
Copy link

Its #19272 (comment) working for me

@facebook facebook deleted a comment from react-native-bot May 16, 2018
@facebook facebook deleted a comment from react-native-bot May 16, 2018
@facebook facebook deleted a comment from react-native-bot May 16, 2018
@react-native-bot
Copy link
Collaborator

It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?

@kelset
Copy link
Contributor

kelset commented May 16, 2018

Closing as duplicate of #19259

@kelset kelset closed this as completed May 16, 2018
@nickngn
Copy link

nickngn commented May 16, 2018

@Mahaswami Thank for your guide... My version is 0.44.0 and it work for me.

@manuTro
Copy link
Author

manuTro commented May 16, 2018

#19272 (comment) worked for me as well! thanks!

@Mahaswami
Copy link

@jupassamani, saw your -1. Can you share what specifically did not work for you so I can update my comments for others benefit? Thanks.

@Hemanth1985
Copy link

I am on RN 0.44.0, I added it configurations.all {
resolutionStrategy {
// START: RN version lockdown
force 'com.facebook.react:react-native:0.44.0’ //Your RN version should go here
// END: RN version lockdown
}
}
and specified the actual version in
react-native-code-push:

dependencies {
 compile "com.facebook.react:react-native:0.44.0”

compile 'com.nimbusds:nimbus-jose-jwt:5.1'
}

i am getting error couldn’t find com.facebook.react:react-native:0.44.0
Can anyone help me?

@jupassamani
Copy link

Hey @Mahaswami I tried

 allprojects {
    repositories {
        mavenLocal()
        jcenter()
        maven {
            url "$rootDir/../node_modules/react-native/android"
        }
        configurations.all {
          resolutionStrategy {
            force 'com.facebook.react:react-native:0.44' 
          }
        }
    }
} 

however it didn't work for me - same error. I also tried to edit android/app/build.gradle

compile ("com.facebook.react:react-native:0.44") { force = true } // From node_modules

no luck so far...

@nickngn
Copy link

nickngn commented Jun 15, 2018

@youki666 You just only comment or remove @OverRide.

@mm909
Copy link

mm909 commented Dec 1, 2018

yarn add react-native
Fixed this issue for me!:)

@facebook facebook locked as resolved and limited conversation to collaborators May 16, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label May 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests