microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
8.98k stars 1.47k forks source link

RN 0.73 issue with 8.1.0 code push #2626

Closed vksgautam1986 closed 9 months ago

vksgautam1986 commented 11 months ago

Thanks so much for filing an issue or feature request! Please fill out the following (wherever relevant): Android Error--- DevInternalSettings is not public in com.facebook.react.devsupport; cannot be accessed from outside package import com.facebook.react.devsupport.DevInternalSettings;

/Users/netsmartz/Desktop/0.72/MobileApplication/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java

Steps to Reproduce

1.

Expected Behavior

What you expected to happen?

Actual Behavior

What actually happens?

  STACK TRACE AND/OR SCREENSHOTS

Reproducible Demo

Environment

(The more info the faster we will be able to address it!) ![Uploading Screenshot 2023-12-04 at 1.28.58 PM.png…]()

vksgautam1986 commented 11 months ago

Screenshot 2023-12-04 at 1 28 58 PM

domhacking commented 11 months ago

I am facing the same issue as I have just upgraded to the same react-native version listed.

MosefAsad commented 11 months ago

Version 0.73 Stable is live and this is still an ongoing issue.

recallwei commented 11 months ago

Facing the same issue.

VMagination commented 11 months ago

temp patch-package should help till they release a patch for this

diff --git a/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java b/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java
index 923dd15..8394acb 100644
--- a/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java
+++ b/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java
@@ -10,7 +10,6 @@ import com.facebook.react.ReactPackage;
 import com.facebook.react.bridge.JavaScriptModule;
 import com.facebook.react.bridge.NativeModule;
 import com.facebook.react.bridge.ReactApplicationContext;
-import com.facebook.react.devsupport.DevInternalSettings;
 import com.facebook.react.devsupport.interfaces.DevSupportManager;
 import com.facebook.react.uimanager.ViewManager;

@@ -152,12 +151,11 @@ public class CodePush implements ReactPackage {
         if (instanceManager != null) {
             DevSupportManager devSupportManager = instanceManager.getDevSupportManager();
             if (devSupportManager != null) {
-                DevInternalSettings devInternalSettings = (DevInternalSettings)devSupportManager.getDevSettings();
-                Method[] methods = devInternalSettings.getClass().getMethods();
+                Method[] methods = devSupportManager.getDevSettings().getClass().getMethods();
                 for (Method m : methods) {
                     if (m.getName().equals("isReloadOnJSChangeEnabled")) {
                         try {
-                            return (boolean) m.invoke(devInternalSettings);
+                            return (boolean) m.invoke(devSupportManager.getDevSettings());
                         } catch (Exception x) {
                             return false;
                         }
agusvazquez commented 11 months ago

@VMagination solution worked for me! Thank you!

vigneshwaran9494 commented 10 months ago

Same issue in with 8.1.1 code push too

Kotpes commented 10 months ago

This works great! In case anyone's wondering how to apply patch: https://github.com/ds300/patch-package#readme

temp patch-package should help till they release a patch for this

diff --git a/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java b/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java
index 923dd15..8394acb 100644
--- a/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java
+++ b/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java
@@ -10,7 +10,6 @@ import com.facebook.react.ReactPackage;
 import com.facebook.react.bridge.JavaScriptModule;
 import com.facebook.react.bridge.NativeModule;
 import com.facebook.react.bridge.ReactApplicationContext;
-import com.facebook.react.devsupport.DevInternalSettings;
 import com.facebook.react.devsupport.interfaces.DevSupportManager;
 import com.facebook.react.uimanager.ViewManager;

@@ -152,12 +151,11 @@ public class CodePush implements ReactPackage {
         if (instanceManager != null) {
             DevSupportManager devSupportManager = instanceManager.getDevSupportManager();
             if (devSupportManager != null) {
-                DevInternalSettings devInternalSettings = (DevInternalSettings)devSupportManager.getDevSettings();
-                Method[] methods = devInternalSettings.getClass().getMethods();
+                Method[] methods = devSupportManager.getDevSettings().getClass().getMethods();
                 for (Method m : methods) {
                     if (m.getName().equals("isReloadOnJSChangeEnabled")) {
                         try {
-                            return (boolean) m.invoke(devInternalSettings);
+                            return (boolean) m.invoke(devSupportManager.getDevSettings());
                         } catch (Exception x) {
                             return false;
                         }
Dallas62 commented 10 months ago

2617

caiodeambrosio commented 9 months ago

Same here =(

nikolal commented 9 months ago

Patch is working fine.

But it would be nice to merge this.

MikhailSuendukov commented 9 months ago

Since the changes have been merged and are now available in the latest version of react-native-code-push we are closing this issue, but if the problem is still present feel free to re-open this issue.

smithmallick149 commented 6 months ago

this issue still persists with react-native 0.73.7

rafaelcorreiapoli commented 5 months ago

Any solutions?

DmitriyKirakosyan commented 4 months ago

@smithmallick149 , @rafaelcorreiapoli , are you facing this error?

Error--- DevInternalSettings is not public in com.facebook.react.devsupport; cannot be accessed from outside package import com.facebook.react.devsupport.DevInternalSettings;

What react-native-code-push version are you using?

Ziad-Hossameldin commented 1 month ago

I have the issue using RN 74.5 and latest code push