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 to Deploy to Android RN 0.73.2 #225

Open
MplanSdrigues opened this issue Mar 20, 2024 · 6 comments
Open

Error to Deploy to Android RN 0.73.2 #225

MplanSdrigues opened this issue Mar 20, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@MplanSdrigues
Copy link

Environment

System:
OS: macOS 14.4
CPU: (8) arm64 Apple M2
Memory: 82.11 MB / 8.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 20.11.1
path: /var/folders/tz/kxc2bv_d2gqgwn1ssc_6qkc80000gn/T/yarn--1710974312753-0.10428707950275529/node
Yarn:
version: 1.22.21
path: /var/folders/tz/kxc2bv_d2gqgwn1ssc_6qkc80000gn/T/yarn--1710974312753-0.10428707950275529/yarn
npm:
version: 10.2.4
path: /usr/local/bin/npm
Watchman:
version: 2024.01.22.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.2
- iOS 17.2
- macOS 14.2
- tvOS 17.2
- visionOS 1.0
- watchOS 10.2
Android SDK: Not Found
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11330709
Xcode:
version: 15.2/15C500b
path: /usr/bin/xcodebuild
Languages:
Java:
version: 17.0.10
path: /usr/bin/javac
Ruby:
version: 2.6.10
path: /usr/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.2
wanted: 0.73.2
react-native-macos: Not Found
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: true
newArchEnabled: false

Platforms

This issue occurs on Android when running ./gradlew bundleRelease

Versions

  • Android:
  • iOS:
  • react-native-netinfo:
  • react-native: 0.73.2
  • react:

Description

when you running ./gradlew bundleRelease to build an .aab app, occored this error

image

Reproducible Demo

@MplanSdrigues MplanSdrigues added the bug Something isn't working label Mar 20, 2024
@chinNuttawot
Copy link

 me too

@edritech93
Copy link

same for me

1 similar comment
@Parathantl
Copy link

same for me

@nguyenductoan1995
Copy link

Is there a way to solve this problem yet, everyone?

@mykhailoperemitko
Copy link

Hey all!

I patched ClipboardModule.java to make it compatible with the latest changes in RN. Seems to work fine for now.

diff --git a/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java b/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
index 4ecb0cb..b664b3c 100644
--- a/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
+++ b/node_modules/@react-native-community/clipboard/android/src/main/java/com/reactnativecommunity/clipboard/ClipboardModule.java
@@ -11,7 +11,9 @@ import android.content.ClipboardManager;
 import android.content.ClipData;
 import android.content.Context;
 
-import com.facebook.react.bridge.ContextBaseJavaModule;
+import com.facebook.react.bridge.ReactApplicationContext;
+import com.facebook.react.bridge.ReactContext;
+import com.facebook.react.bridge.ReactContextBaseJavaModule;
 import com.facebook.react.bridge.ReactMethod;
 import com.facebook.react.bridge.Promise;
 import com.facebook.react.module.annotations.ReactModule;
@@ -20,10 +22,13 @@ import com.facebook.react.module.annotations.ReactModule;
  * A module that allows JS to get/set clipboard contents.
  */
 @ReactModule(name = ClipboardModule.NAME)
-public class ClipboardModule extends ContextBaseJavaModule {
+public class ClipboardModule extends ReactContextBaseJavaModule {
+  private Context context;
 
-  public ClipboardModule(Context context) {
+  public ClipboardModule(ReactApplicationContext context) {
     super(context);
+
+    this.context = context;
   }
 
   public static final String NAME = "RNCClipboard";
@@ -34,7 +39,7 @@ public class ClipboardModule extends ContextBaseJavaModule {
   }
 
   private ClipboardManager getClipboardService() {
-    return (ClipboardManager) getContext().getSystemService(getContext().CLIPBOARD_SERVICE);
+    return (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
   }
 
   @ReactMethod

@Naturalclar Naturalclar self-assigned this Apr 3, 2024
@andriiradkevych
Copy link

andriiradkevych commented Apr 24, 2024

@Naturalclar isn't it the same #238

@mykhailoperemitko can you check ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants