react-native-screen-brightness
react-native-screen-brightness copied to clipboard
【Solve】Build failed with an exception
Hello, I follow it .
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
I solved it.
The Cause:
I react-native is "0.39.2". OS: windows 10 Mobile platform: Android 6.0
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
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?