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

【Solve】Build failed with an exception #14

Open
yuansyuntw opened this issue Mar 1, 2017 · 2 comments
Open

【Solve】Build failed with an exception #14

yuansyuntw opened this issue Mar 1, 2017 · 2 comments

Comments

@yuansyuntw
Copy link

Hello, I follow it .

LINK

But I can not build it successfully.

:react-native-screen-brightness:compileReleaseJavaWithJavac
D:\Racti Native\Anping_V002\node_modules\react-native-screen-brightness\android\src\main\java\com\robinpowered\react\ScreenBrightness\ScreenBrightnessModule.java:28: error: ScreenBrightnessModule is not abstract and does not override abstract method onNewIntent(Intent) in ActivityEventListener
public class ScreenBrightnessModule extends ReactContextBaseJavaModule
       ^
D:\Racti Native\Anping_V002\node_modules\react-native-screen-brightness\android\src\main\java\com\robinpowered\react\ScreenBrightness\ScreenBrightnessModule.java:64: error: method does not override or implement a method from a supertype
    @Override
    ^
2 errors
:react-native-screen-brightness:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

How can I modify it?
Thanks

@yuansyuntw
Copy link
Author

I solved it.

The Cause:

I react-native is "0.39.2".
OS: windows 10
Mobile platform: Android 6.0

RN 0.33 Modify

ReactAndroid/src/main/java/com/facebook/react/bridge/ActivityEventListener.java
 @@ -2,17 +2,19 @@
  
  package com.facebook.react.bridge;
  
 +import android.app.Activity;
  import android.content.Intent;
  
  /**
 - * Listener for receiving activity events.
 + * Listener for receiving activity events. Consider using {@link BaseActivityEventListener} if
 + * you're not interested in all the events sent to this interface.
   */
  public interface ActivityEventListener {
  
    /**
     * Called when host (activity/service) receives an {@link Activity#onActivityResult} call.
     */
 -  void onActivityResult(int requestCode, int resultCode, Intent data);
 +  void onActivityResult(Activity activity, int requestCode, int resultCode, Intent data);
  
    /**
     * Called when a new intent is passed to the activity
    */
   void onNewIntent(Intent intent);
 }

The solution:

Modify File

node_modules\react-native-screen-brightness\android\src\main\java\com\robinpowered\react\ScreenBrightness\ScreenBrightnessModule.java

open picture

@yuansyuntw yuansyuntw changed the title Build failed with an exception 【Solve】Build failed with an exception Mar 1, 2017
@yuansyuntw yuansyuntw reopened this Mar 3, 2017
@Pazokita
Copy link

Hello, I have almost the same issue, my build failed with this errir : Task :react-native-screen-brightness:javaPreCompileDebug FAILED, I can't see what do I have to change on node_modules\react-native-screen-brightness\android\src\main\java\com\robinpowered\react\ScreenBrightness\ScreenBrightnessModule.java, could you tell me please?

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

3 participants
@yuansyuntw @Pazokita and others