React-native-navigation: Error on Android device with RN 0.58.1

Created on 27 Jan 2019  ·  14Comments  ·  Source: wix/react-native-navigation

Issue Description

When I run - npm run android --stacktrace has an error:

Task :react-native-navigation:compileReactNative57_5DebugJavaWithJavac FAILED
/node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/NoOpPromise.java:7: error: NoOpPromise is not abstract and does not override abstract method reject(String,String,Throwable,WritableMap) in Promise
public class NoOpPromise implements Promise {

/node_modules/react-native-navigation/lib/android/app/src/reactNative57_5/java/com/reactnativenavigation/react/SyncUiImplementation.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

FAILURE: Build failed with an exception.


Environment

  • React Native Navigation version: 2.8.0
  • React Native version: 0.58.1
  • Platform(s) (iOS, Android, or both?): Android
  • Device info (Simulator/Device? OS version? Debug/Release?): Simulator

Most helpful comment

Hello Everyone, I managed to solve this error using following steps :

  1. First navigate to /node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ and open NoOpPromise.java.
  2. As is clear from the error this file doesn't override required methods from Promise class.
    Replace this file with the following file or manually write the required methods.
package com.reactnativenavigation.utils;

import com.facebook.react.bridge.*;

import javax.annotation.Nullable;

public class NoOpPromise implements Promise {
    @Override
    public void resolve(@Nullable Object value) {

    }

    @Override
    public void reject(String code, String message) {

    }

    @Override
    public void reject(String code, Throwable e) {

    }

    @Override
    public void reject(String code, String message, Throwable e) {

    }

    @Deprecated
    @Override
    public void reject(String message) {

    }

    @Override
    public void reject(Throwable reason) {

    }

    /*Extra Methods*/

    @Override
    public void reject(String code, String message, Throwable e, WritableMap a) {

    }

   @Override
    public void reject(Throwable e, WritableMap a) {

    }

   @Override
    public void reject(String code, String message, WritableMap a) {

    }

   @Override
    public void reject(String code, Throwable e, WritableMap a) {

    }

   @Override
    public void reject(String code, WritableMap a) {

    }
}
  1. Now run npm run android and these issues will disappear.

Enjoy Coding 👍

All 14 comments

I'm also getting the same error.

I returned to RN 0.57.8. And all work

Yes it's what i dit too; thanks

Le dim. 27 janv. 2019 à 17:59, Aleksey notifications@github.com a écrit :

I returned to RN 0.57.8. And all work


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/wix/react-native-navigation/issues/4646#issuecomment-457939558,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AicFWdmDN7fs5qsAsMwm8pMpyKqgQMJFks5vHekEgaJpZM4aUson
.

seeing the same issue

Hello Everyone, I managed to solve this error using following steps :

  1. First navigate to /node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ and open NoOpPromise.java.
  2. As is clear from the error this file doesn't override required methods from Promise class.
    Replace this file with the following file or manually write the required methods.
package com.reactnativenavigation.utils;

import com.facebook.react.bridge.*;

import javax.annotation.Nullable;

public class NoOpPromise implements Promise {
    @Override
    public void resolve(@Nullable Object value) {

    }

    @Override
    public void reject(String code, String message) {

    }

    @Override
    public void reject(String code, Throwable e) {

    }

    @Override
    public void reject(String code, String message, Throwable e) {

    }

    @Deprecated
    @Override
    public void reject(String message) {

    }

    @Override
    public void reject(Throwable reason) {

    }

    /*Extra Methods*/

    @Override
    public void reject(String code, String message, Throwable e, WritableMap a) {

    }

   @Override
    public void reject(Throwable e, WritableMap a) {

    }

   @Override
    public void reject(String code, String message, WritableMap a) {

    }

   @Override
    public void reject(String code, Throwable e, WritableMap a) {

    }

   @Override
    public void reject(String code, WritableMap a) {

    }
}
  1. Now run npm run android and these issues will disappear.

Enjoy Coding 👍

Hi! Great work)))
But I think it`s a bad solution, because after updating dependencies this error will return ((((
It must be a PR to RNN and then we can updated)))
But, now I will work with stable version RN 0.57.8

@Alekseyideas right.

@arpansharma7474

Thank you, ur a life saver!!!!

@Alekseyideas you can use something like patch-package to be able to keep the changes around.

@guyca I also have this issue with version react-native 0.58.3 and react-native-navigation 2.8.0.0
Can we resolve this issue asap?
I cannot upgrade my starter-kit with the latest versions. :)

is this error fixed on 2.11.0?

Yes

Hello Everyone, I managed to solve this error using following steps :

1. First navigate to /node_modules/react-native-navigation/lib/android/app/src/main/java/com/reactnativenavigation/utils/ and open NoOpPromise.java.

2. As is clear from the error this file doesn't override required methods from Promise class.
   Replace this file with the following file or manually write the required methods.
package com.reactnativenavigation.utils;

import com.facebook.react.bridge.*;

import javax.annotation.Nullable;

public class NoOpPromise implements Promise {
    @Override
    public void resolve(@Nullable Object value) {

    }

    @Override
    public void reject(String code, String message) {

    }

    @Override
    public void reject(String code, Throwable e) {

    }

    @Override
    public void reject(String code, String message, Throwable e) {

    }

    @Deprecated
    @Override
    public void reject(String message) {

    }

    @Override
    public void reject(Throwable reason) {

    }

    /*Extra Methods*/

    @Override
    public void reject(String code, String message, Throwable e, WritableMap a) {

    }

   @Override
    public void reject(Throwable e, WritableMap a) {

    }

   @Override
    public void reject(String code, String message, WritableMap a) {

    }

   @Override
    public void reject(String code, Throwable e, WritableMap a) {

    }

   @Override
    public void reject(String code, WritableMap a) {

    }
}
1. Now run `npm run android` and these issues will disappear.

Enjoy Coding 👍

Still got nothing tho, I still got the same error

Was this page helpful?
0 / 5 - 0 ratings