Closed vksgautam1986 closed 9 months ago
I am facing the same issue as I have just upgraded to the same react-native version listed.
Version 0.73 Stable is live and this is still an ongoing issue.
Facing the same issue.
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;
}
@VMagination solution worked for me! Thank you!
Same issue in with 8.1.1 code push too
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; }
Same here =(
Patch is working fine.
But it would be nice to merge this.
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.
this issue still persists with react-native 0.73.7
Any solutions?
@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?
I have the issue using RN 74.5 and latest code push
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?
Reproducible Demo
Examples
folder runnode create-app.js appName react-native@0.61.5 react-native-code-push@6.0.0
command to generate plain CodePushified React Native app. Please see description on top ofcreate-app.js
file content if neededEnvironment
(The more info the faster we will be able to address it!) ![Uploading Screenshot 2023-12-04 at 1.28.58 PM.png…]()