React-native-code-push: Updates on iOS always fails then rolls back without being marked as failed

Created on 22 Oct 2019  路  19Comments  路  Source: microsoft/react-native-code-push

Steps to Reproduce

I have no idea how to reproduce this. It's probably some very specific combination of things.

Expected Behavior

CodePush updates to deploy onto the device

Actual Behavior

The update is correctly created in appcenter, downloads onto the device, restarts to apply, then always crashes.

Environment

  • react-native-code-push version: 5.7.0
  • react-native version: 0.61.1
  • iOS/Android/Windows version:
  • Does this reproduce on a debug build or release build? Both
  • Does this reproduce on a simulator, or only on a physical device?

Description

Ok, this has been driving me crazy. Some quick context - I've been using CP in a production app for over a year, so I'm familiar with the tool.

In my new project ( started on 0.60+, so AppDelegate.m has a different structure than my original project), codepush on iOS has never worked on iOS.

It's linked via cocoapods (although I've tried linking it both manually and via RNPM). It builds fine.

My app implementation is:

 const codePushOptions = {
  deploymentKey:
    Platform.OS === 'ios'
      ? Config.CODEPUSH_IOS_DEPLOYMENT_KEY
      : Config.CODEPUSH_ANDROID_DEPLOYMENT_KEY,
  checkFrequency: codePush.CheckFrequency.ON_APP_RESUME,
  updateDialog: true,
  installMode: codePush.InstallMode.ON_NEXT_RESUME,
};

I'm confident my deployment key config is correct. I've also tested it with this value hardcoded for iOS.

It wraps my App.tsx:

export default codePush(codePushOptions)(App);

Sync in constructor:

codePush.sync(codePushOptions);

The only error I've been able to reproduce is by running a release build on a physical device via xcode, which then throws the following upon app restart:

[CodePush] Loading JS bundle from file:///private/var/containers/Bundle/Application/A4611862-F45B-43DB-A7E9-77362C67F199/NFUMobileApp.app/main.jsbundle
2019-10-21 20:33:53.483085-0400 NFUMobileApp[14048:958211] 
[CodePush] Loading JS bundle from file:///private/var/containers/Bundle/Application/A4611862-F45B-43DB-A7E9-77362C67F199/NFUMobileApp.app/main.jsbundle
2019-10-21 20:33:53.746275-0400 NFUMobileApp[14048:958211] Sentry Started -- Version: 4.4.0
2019-10-21 20:33:56.498773-0400 NFUMobileApp[14048:958400] 
[CodePush] Applying full update.
2019-10-21 20:33:56.504216-0400 NFUMobileApp[14048:958211] 
[CodePush] Loading JS bundle from file:///var/mobile/Containers/Data/Application/E7E3A52E-EC47-4741-BBF7-6816398193BE/Library/Application%20Support/CodePush/2dd566b366d689250fb122047612c2323044e93e26f7315dcd1720dd457ae196/CodePush/main.jsbundle
2019-10-21 20:33:56.504754-0400 NFUMobileApp[14048:958211] 
[CodePush] Loading JS bundle from file:///var/mobile/Containers/Data/Application/E7E3A52E-EC47-4741-BBF7-6816398193BE/Library/Application%20Support/CodePush/2dd566b366d689250fb122047612c2323044e93e26f7315dcd1720dd457ae196/CodePush/main.jsbundle
2019-10-21 20:33:56.598009-0400 NFUMobileApp[14048:958400] 11111 [self.webView loadHTMLString:html baseURL:url];
2019-10-21 20:33:56.598078-0400 NFUMobileApp[14048:958211] 222222 [self.webView loadHTMLString:html baseURL:url];
2019-10-21 20:33:56.692 [error][tid:com.facebook.react.JavaScript] Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
2019-10-21 20:33:56.694 [fatal][tid:com.facebook.react.ExceptionsManagerQueue] Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.
2019-10-21 20:33:56.694744-0400 NFUMobileApp[14048:958390] *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.', reason: 'Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the na..., stack:
getEnforcing@2055:28
<unknown>@40858:50
loadModuleImplementation@271:14
<unknown>@40817:40
loadModuleImplementation@271:14
<unknown>@35398:18
loadModuleImplementation@271:14
<unknown>@28648:16
loadModuleImplementation@271:14
guardedLoadModule@163:47
global code@247452:4
'
*** First throw call stack:
(0x1bde5dc30 0x1bdb780c8 0x102d43da4 0x102db5ad8 0x1bde64724 0x1bdd2d280 0x1bdd2de90 0x102d767d0 0x102d788e0 0x102d78644 0x1039fde48 0x1039ff2a8 0x103a06938 0x103a07528 0x103a124e8 0x1bdb6aaa0 0x1bdb70c78)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

I'm uncertain of whether this is the actual issue, but it is happening at the right "point".

It seems like this issue --> https://github.com/facebook/react-native/issues/26614 could be related? The only difference I've been able to discern in the config between my original project and this one is that AppDelegate.m is structured differently, since my newer project has the updated structure which means the jsCodeLocation is specified through the bridge instead of directly. Gist --> https://gist.github.com/ahartzog/4df82472771a5750bf33fe30f678a81e

I'm really at my wits end here. I'd be happy to offer some sort of bounty or reward if somebody can help me get this resolved without sucking a ton more time.

Here's my podfile too, it has all of the libs included in the update to 0.61 --> https://gist.github.com/ahartzog/bf3066a892f9df7d6117ce1da2e62cb9

iOS

Most helpful comment

Having the same issue here!

All 19 comments

Facing SImilar Issues! Getting Rollbacks for iOS 13

Anyone helps?

Having the same issue here!

We are experiencing the same issue! We have spent the better part of 2 days trying to debug it. Everything for the most part works as expected on iOS 13 and RN 0.61.4, it checks for update, recognizes update, downloads the update but then upon installing the app crashes with the following error:

Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'DevSettings' could not be found. Verify that a module by this name is registered in the native binary.

This crash occurs on both Debug and Release builds and exists using the sync API as well as the HOC method. We are stuck at this point and it seems as though Microsoft has slowly ceased support for CodePush (likely working on a similar product for AppCenter).

If anybody finds a solution to this please share!

UPDATE: Downgrading react-native to 0.60.5 fixed our issues.

@luskin were you using the --development flag when building your releases?

Removing that has fixed this issue for me.

To be more clear, I'm talking about the --development flag when actually building a release via the appcenter CLI.

@ahartzog We receive this error when building full release via Xcode so I don鈥檛 think this is a true fix. I鈥檓 glad it鈥檚 working for you but unless there is some hidden development flag in our Xcode release scheme (which would be odd) then we are still faced with this issue.

@luskin what about in your codepush build process? Very curious if you were using that --development flag in the release-react command.

npx appcenter-cli codepush release-react -a Nerd-Fitness/Nerd-Fitness-Universe-iOS -d Staging -t $VERSION_NAME -m --development -o ./.build/ios

to

npx appcenter-cli codepush release-react -a Nerd-Fitness/Nerd-Fitness-Universe-iOS -d Staging -t $VERSION_NAME -m -o ./.build/ios

I'm not using --development flag, but still facing the issue. Update installed on first time but rolled back on the next launch of the app.

Has anyone managed to successfully use CodePush with 0.61.x?

@henrymoulton Yes, using RN 0.61.4 and codepush 6.0.0. It still has a decent number of hiccups, but is overall working on iOS and Android for our production deploys.

@jehartzog That's awesome you have it working, our team has spent a long time trying to resolve the roll back issue and have yet to get it working. We have officially given up and removed code push from our app until they provide an update.

Yeah, frustrating that the maintainers won't even give us an update on a roadmap for the supposed re-write. I have it working on 0.61 as well, but it's definitely fragile.

Would love to see CodePush have paid plans so that companies that rely on it can support its development. OTA updates is one of React Native鈥檚 massive plus points.

@henrymoulton Agreed, however it looks like they have plans to integrate it fully as a product of AppCenter (which many of us pay for already). It's taking them a while but I have faith when they do release an update it will be a solid rewrite and baked fully into the appcenter package.

@luskin off topic, but out of interest which other parts of App Center do you use (and did you do any shopping around comparing Amplify/Firebase :D)

I鈥檝e inherited an old React Native app and looking for a solid Push Notification offering.

We primarily use it for CI/CD. We used to manage fastlane locally and it was great, but fragile. AppCenter (IMO) does the best job of managing your build and deploys for you. Firebase does not even offer this and I haven't used Amplify. Our QA team also provides appium tests to run on their device farm.

Hi @ahartzog,
Thank you for reporting!

As I can see, you are using react-native v0.61.1 and react-native-code-push v5.7.0 but these are incompatible versions, you can take a look at supporting CodePush versions here: https://github.com/microsoft/react-native-code-push#supported-react-native-platforms

Not so long ago we released a new version of Code Push which supports react-native v0.60-v0.61.
All steps for installing the latest version of the plugin are described in our documentation: https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-ios.md

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

diegocouto picture diegocouto  路  4Comments

cgerikj picture cgerikj  路  3Comments

EdmundMai picture EdmundMai  路  4Comments

kevando picture kevando  路  4Comments

Fuhrmann picture Fuhrmann  路  3Comments