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 on Android device with RN 0.58.1 #4646

Closed
Alekseyideas opened this issue Jan 27, 2019 · 14 comments
Closed

Error on Android device with RN 0.58.1 #4646

Alekseyideas opened this issue Jan 27, 2019 · 14 comments

Comments

@Alekseyideas
Copy link

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
@Alekseyideas Alekseyideas changed the title Error Android device with RN 0.58.1 Error with Android device with RN 0.58.1 Jan 27, 2019
@Alekseyideas Alekseyideas changed the title Error with Android device with RN 0.58.1 Error on Android device with RN 0.58.1 Jan 27, 2019
@Tahirou-DIABATE
Copy link

I'm also getting the same error.

@Alekseyideas
Copy link
Author

I returned to RN 0.57.8. And all work

@Tahirou-DIABATE
Copy link

Tahirou-DIABATE commented Jan 27, 2019 via email

@Angry-Potato
Copy link

seeing the same issue

@retyui
Copy link
Contributor

retyui commented Jan 28, 2019

You can find tmp decision here: #4639 (comment)

@arpansharma7474
Copy link

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 👍

@Alekseyideas
Copy link
Author

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

@Tahirou-DIABATE
Copy link

@Alekseyideas right.

@nugoo1
Copy link

nugoo1 commented Jan 29, 2019

@arpansharma7474

Thank you, ur a life saver!!!!

@deecewan
Copy link

deecewan commented Jan 31, 2019

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

@atoami
Copy link
Contributor

atoami commented Feb 4, 2019

@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. :)

alpha0010 added a commit to alpha0010/react-native-navigation that referenced this issue Feb 7, 2019
* Removed unused class

Fixes wix#4646
guyca pushed a commit that referenced this issue Feb 8, 2019
Removed unused class which isn't compatible with RN 0.58

Fixes #4646
@cinder92
Copy link

is this error fixed on 2.11.0?

@guyca
Copy link
Collaborator

guyca commented Feb 11, 2019

Yes

@krookten14
Copy link

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

@wix wix deleted a comment from Tahirou-DIABATE May 20, 2019
GaetanD pushed a commit to tano-interactive/rnn-ti-sp-fork that referenced this issue Aug 9, 2019
vshkl pushed a commit to vshkl/react-native-navigation that referenced this issue Feb 5, 2020
Removed unused class which isn't compatible with RN 0.58

Fixes wix#4646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests