React-native-code-push: Build failed with React Native 0.62

Created on 27 Mar 2020  ·  7Comments  ·  Source: microsoft/react-native-code-push

> Task :react-native-code-push:compileDebugJavaWithJavac FAILED
/Users/lusheng.lls/workspace/brm-apps/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePush.java:157: error: cannot find symbol
                isLiveReloadEnabled = devInternalSettings.isReloadOnJSChangeEnabled();
                                                         ^
  symbol:   method isReloadOnJSChangeEnabled()
  location: variable devInternalSettings of type DevInternalSettings
Note: /Users/lusheng.lls/workspace/brm-apps/node_modules/react-native-code-push/android/app/src/main/java/com/microsoft/codepush/react/CodePushNativeModule.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

Root cause: https://github.com/facebook/react-native/commit/478df155e70a4ce30219adcac6f0801c4e4d10ec#diff-2fc30127a6c6568653505923bbd3bdbb

compatibility

Most helpful comment

@astulip thanks for this, the above fixed the problem for me.

All in all I had to do the following to get this running on RN62:

settings.gradle

rootProject.name = 'boilerplate'

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')

node_modules / react-native-code-push / android / app / src / main / java / com / microsoft / codepush / react / CodePush.java

        if (instanceManager != null) {
            DevSupportManager devSupportManager = instanceManager.getDevSupportManager();
            if (devSupportManager != null) {
                DevInternalSettings devInternalSettings = (DevInternalSettings)devSupportManager.getDevSettings();
                isLiveReloadEnabled = devInternalSettings.isHotModuleReplacementEnabled();
            }
        }

All 7 comments

My solution is to change isReloadOnJSChangeEnabled to isHotModuleReplacementEnabled

node_modules / react-native-code-push / android / app / src / main / java / com / microsoft / codepush / react / CodePush.java

Compile and wait for the official website to fix it.

May I ask you actually managed to compile it?
I'm stuck on it failing configuration (see the other issue related to compiling)

我也是今天升级到RN62的,一切顺利,并且我的RN程序还集成了Flutter(1.12.13)也是顺利升级。
I also upgraded to RN62 today. Everything went well, and my RN program also integrated Flutter (1.12.13) and was upgraded smoothly.

"react-native-code-push": "^6.1.1"

@astulip thanks for this, the above fixed the problem for me.

All in all I had to do the following to get this running on RN62:

settings.gradle

rootProject.name = 'boilerplate'

apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-code-push/android/app')

node_modules / react-native-code-push / android / app / src / main / java / com / microsoft / codepush / react / CodePush.java

        if (instanceManager != null) {
            DevSupportManager devSupportManager = instanceManager.getDevSupportManager();
            if (devSupportManager != null) {
                DevInternalSettings devInternalSettings = (DevInternalSettings)devSupportManager.getDevSettings();
                isLiveReloadEnabled = devInternalSettings.isHotModuleReplacementEnabled();
            }
        }

any update ?

Hi all,
Thanks for reporting!

As @lukebars mentioned, https://github.com/microsoft/react-native-code-push/pull/1829 solved this issue and we made new release: https://github.com/microsoft/react-native-code-push/releases/tag/v6.2.0

I'm going to close this issue for now. Please feel free to reopen it if you have any questions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vira-khdr picture vira-khdr  ·  3Comments

SudoPlz picture SudoPlz  ·  4Comments

diegocouto picture diegocouto  ·  4Comments

djw27 picture djw27  ·  3Comments

sergey-akhalkov picture sergey-akhalkov  ·  4Comments