react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

[Android]: error: method does not override or implement a method from a supertype

Open FerdinandvHagen opened this issue 10 years ago • 4 comments

I can't compile the app on Android with RN 0.30.0 and Code Push 1.14.4-beta.

MainApplication.java:37: error: method does not override or implement a method from a supertype
  @Override
  ^
1 error
:app:compileDebugJavaWithJavac FAILED

which points to

  // 2. Override the getJSBundleFile method in order to let
  // the CodePush runtime determine where to get the JS
  // bundle location from on each app start
  @Override
  protected String getJSBundleFile() {
    return CodePush.getJSBundleFile();
  }

FerdinandvHagen avatar Aug 18 '16 10:08 FerdinandvHagen

Just found the error. Placed the function in the wrong method body.

Sorry for the trouble!

FerdinandvHagen avatar Aug 18 '16 10:08 FerdinandvHagen

Hello I'm still having this issue with "react-native": "0.47.1" and "react-native-code-push": "^2.0.3-beta"

com/microsoft/codepush/react/CodePush.java:295: error: method does not override or implement a method from a supertype
    @Override
    ^
1 error
:react-native-code-push:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-code-push:compileReleaseJavaWithJavac'.

This is for android. Any help?

nicotroia avatar Aug 08 '17 07:08 nicotroia

@nicotroia please checkout our compatibility table - https://github.com/Microsoft/react-native-code-push#supported-react-native-platforms. Seems that your version of code push plugin is not supported by RN 0.47

max-mironov avatar Aug 08 '17 07:08 max-mironov

Hi There, I'm getting this same error but I have it in the correct place and the correct versions:

React Native: 0.46.4 React Native Code Push: 4.1.0-beta

public class ReactNative extends Activity implements DefaultHardwareBackBtnHandler, ReactApplication {

    private static final int OVERLAY_PERMISSION_REQ_CODE = 1;
    private ReactRootView mReactRootView;
    private ReactInstanceManager mReactInstanceManager;

    @Override // <-- Method does not override method from it's super class.
    public String getJSBundleFile() {
        return CodePush.getJSBundleFile();
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // ...
    }

I think this is the reason why my app sees that there is an update, downloads the update, restarts the app but nothing actually changes. I imagine it's because it's not getting the updated JS bundle.

Help please! :)

joshuapinter avatar Aug 18 '17 14:08 joshuapinter