react-native-navigation icon indicating copy to clipboard operation
react-native-navigation copied to clipboard

Error on Android device with RN 0.58.1

Open Alekseyideas opened this issue 7 years ago • 13 comments

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 avatar Jan 27 '19 12:01 Alekseyideas

I'm also getting the same error.

Tahirou-DIABATE avatar Jan 27 '19 16:01 Tahirou-DIABATE

I returned to RN 0.57.8. And all work

Alekseyideas avatar Jan 27 '19 17:01 Alekseyideas

Yes it's what i dit too; thanks

Le dim. 27 janv. 2019 à 17:59, Aleksey [email protected] 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 .

Tahirou-DIABATE avatar Jan 27 '19 18:01 Tahirou-DIABATE

seeing the same issue

Angry-Potato avatar Jan 28 '19 08:01 Angry-Potato

You can find tmp decision here: https://github.com/wix/react-native-navigation/issues/4639#issuecomment-457600144

retyui avatar Jan 28 '19 09:01 retyui

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 👍

arpansharma7474 avatar Jan 28 '19 16:01 arpansharma7474

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 avatar Jan 28 '19 16:01 Alekseyideas

@Alekseyideas right.

Tahirou-DIABATE avatar Jan 28 '19 18:01 Tahirou-DIABATE

@arpansharma7474

Thank you, ur a life saver!!!!

nugoo1 avatar Jan 29 '19 07:01 nugoo1

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

deecewan avatar Jan 31 '19 03:01 deecewan

is this error fixed on 2.11.0?

cinder92 avatar Feb 11 '19 06:02 cinder92

Yes

guyca avatar Feb 11 '19 07:02 guyca

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

krookten14 avatar Mar 30 '19 19:03 krookten14