react-native-code-push icon indicating copy to clipboard operation
react-native-code-push copied to clipboard

[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'.

Open fanyuRN opened this issue 10 years ago • 16 comments

I have setted codepushdeployment key within my infolist ,how to solve it?

fanyuRN avatar Aug 18 '16 09:08 fanyuRN

Could you show us your info.plist and mask out the key?

geof90 avatar Aug 18 '16 17:08 geof90

sure, 4cb6b747-3e34-453b-bd06-0c62e16feefc

d959e334-39ce-46cb-98f3-45263442f4bb

fanyuRN avatar Aug 19 '16 01:08 fanyuRN

Are you running the debug scheme? From your screenshots CODEPUSH_KEY is not defined in debug.

geof90 avatar Aug 19 '16 05:08 geof90

yeah, I don't set the debug key ,I am running app in the simulator ,

fanyuRN avatar Aug 19 '16 08:08 fanyuRN

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.

geof90 avatar Aug 19 '16 18:08 geof90

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!

fanyuRN avatar Aug 22 '16 02:08 fanyuRN

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.

image

geof90 avatar Aug 23 '16 01:08 geof90

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.

zaach avatar Aug 27 '16 22:08 zaach

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?

geof90 avatar Aug 27 '16 22:08 geof90

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.

zaach avatar Aug 28 '16 01:08 zaach

thank you ,I hava got it

fanyuRN avatar Aug 28 '16 02:08 fanyuRN

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

RomanISWG avatar Aug 25 '17 07:08 RomanISWG

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!

PizzaLiu avatar Oct 23 '17 08:10 PizzaLiu

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)}`);

iwasrobbed-ks avatar Dec 19 '17 20:12 iwasrobbed-ks

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.

iwasrobbed-ks avatar Jan 26 '18 17:01 iwasrobbed-ks

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?

mattcolman avatar Aug 17 '18 01:08 mattcolman