[CodePush] 400,An update check must include a valid deployment key - please check that your app has been configured correctly. To view available deployment keys, run 'code-push deployment ls <appName> -k'.
I have setted codepushdeployment key within my infolist ,how to solve it?
Could you show us your info.plist and mask out the key?
sure,


Are you running the debug scheme? From your screenshots CODEPUSH_KEY is not defined in debug.
yeah, I don't set the debug key ,I am running app in the simulator ,
Since CODEPUSH_KEY is not defined in debug, the 400 is expected behavior because you are not sending a deployment key from which to get updates from.
I have defined CODEPUSH_KEY in debug ,it seem to no effect ;and I use CodePush.sync(); I dont't know Staging and production is how to map app's development environmeng ,is Provisioning Profile? thank you!
I assume you followed the Multi-Deployment Testing section of our docs.
The deployment key is used to query updates with a particular deployment. If you release to Staging, then any app configured with the Staging key will get the update. That section of the docs assumes that you won't want to use CodePush during development/Debug, and you will want to prepare a Staging build for your internal testers, then a Release build for publishing to the app store. So, the staging build should be configured with the Staging key, and the Release build will be conifgured with the Production key. You would then make CodePush releases to Staging first, so that once testers have signed off, you can promote the release to Production so that production users can see it.
To do a Staging/Release build, you can click on your target > Edit Scheme and change the run configuration to Staging/Release.

I'm running into this problem as well. I hardcoded CodePushDeploymentKey to one of my deployment keys just to be sure, but it's still giving this error. Any other ways to debug it? Probably unrelated but code-push debug ios doesn't output anything.
code-push debug ios might not output anything if your app is running in a release build. Could you try running it in debug mode, and if code-push debug ios still doesn't work, try running it from xcode to see the debug logs?
I didn't see any output for the debug build unless I use jsCodeLocation = [CodePush bundleURL];, which results in this being logged: [03:38:56] Loading JS bundle from (null), and the app not launching.
thank you ,I hava got it
I have the same problem. What ever I do, nothing helps. I have also set multi-deployment but still getting this error. Can anyone help please? code-push 2.0.2-beta react-native 0.47.2, react-native-cli 2.0.1
What I have found is that if you just add the Multi-Deployment Testing , you'd better clean the project and rebuild it in Xcode (Project / Clean). Hope this help guys!
We ran into this situation as well. It'd be nice if you all logged the error or rethrow it instead of swallowing it.
For now, you can dump it by modifying react-native-code-push/CodePush.js to add:
log(`Error is ` + e);
// above this line
log(`Report status failed: ${JSON.stringify(statusReport)}`);
Also, this relates to https://github.com/Microsoft/code-push/issues/290#issuecomment-236392414
To ensure compatibility between the native binary interface and the dynamically updated JS, CodePush versions your binary code using the App Store version of your app. We expect this version to follow semver (e.g. 1.0.0), so it's likely that you just need to change it to conform to the format.
Hi, I'm experiencing this issue after updating packages from:
"react-native": "0.42.3",
"react-native-code-push": "1.17.4-beta",
to
"react-native": "0.56.0",
"react-native-code-push": "5.4.1",
When running Staging or Release build it works fine, but running a Debug build throws an error. I want to run Debug builds so I don't have to codepush new code for every change while I'm testing.
I followed the "Multi-Deployment Testing" link so I have not defined a deployment key for DEBUG. I also have this code to read the jsCodeLocation from the local bundle and not codepush.
#ifdef DEBUG
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
#else
jsCodeLocation = [CodePush bundleURL];
#endif
I get this error:
400: An update check must include a valid deployment key - please check that your app has been configured correctly.
So why is codepush still trying to do an update??
My codepush implementation is:
export default codePush({ checkFrequency: codePush.CheckFrequency.ON_APP_RESUME })(App);
@fanyuRN this was over a year ago but you seemed to have solved this same issue. Do you remember what fixed it?