microsoft / react-native-code-push

React Native module for CodePush
http://appcenter.ms
Other
9k stars 1.48k forks source link

[IOS][CodePush] Error! Public key was provided but there is no JWT signature within app bundle #1396

Closed tlweiii6465 closed 6 years ago

tlweiii6465 commented 6 years ago

I just meet some bug in my project did somebody know how to fix it?

this problem is occur in my ios project, it will download update but after download finish it just show this error and android is work fine

[CodePush] Error! Public key was provided but there is no JWT signature within app bundle to verify Possible reasons, why that might happen:

  1. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.
  2. You've been released CodePush bundle update without providing --privateKeyPath option.

and after reopen it, it will show an error like this

[CodePush] An update is available, but it is being ignored due to having been previously rolled back.

tlweiii6465 commented 6 years ago

i have saw some solution like change appcenter-cli and code-push file but i haven't install all of that component

alexandergoncharov-zz commented 6 years ago

Hi @tlweiii6465 , Thanks for reporting!

Could you please provide command which you used for release update?

tlweiii6465 commented 6 years ago

Hi @alexandergoncharov, Thank for reply!

i'm using this command "appcenter codepush release-react -a Project-ios -d Staging"

alexandergoncharov-zz commented 6 years ago

Hi @tlweiii6465 , Sorry for this delay!

It is looks like to CodePush try to install release on device with enabled sign feature but your release wasn't signed. So, CodePush prevent installing this release. For use sign feature you should add add private key for all releases. So your command should looks like so: appcenter codepush release-react -a Project-ios -d Staging -k private.pem

Please let me know if it was helpful or you have any questions.

Thanks, Alexander

tlweiii6465 commented 6 years ago

Hi @alexandergoncharov , Thank for reply

i have try this command, the release is success but the error is still, and i have also try using this command "code-push release-react Project-ios ios -d Staging -k ~/.ssh/private.pem" but still can't. I have try to reopen a new deployment (with empty metadata) but it detected an update package so is that because the older update package is stopped the newest update package? Can i know how to clean all the code push update package?

alexandergoncharov-zz commented 6 years ago

it detected an update package so is...

@tlweiii6465, Could you please clarify what is "it"?

You can use create new deployment with this command: appcenter codepush deployment add -a <userName>/<appName> <deploymentName> or clean existing deployment with this command: appcenter codepush deployment clear -a <userName>/<appName> <deploymentName>

Also, before clearing your deployments could you please run this command: code-push deployment history <yourAppName> <yourTargetDeploymentName> --format=json You'll see json with your releases. Find your issue release, download release package(for this use blobUrl filed), add .zip for your downloaded file and unzip it. Please check your root folder. It should be CodePush name. Please let me know if it so or wrong.

Thanks, Alexander

tlweiii6465 commented 6 years ago

@alexandergoncharov , Hi thank for reply,

I tried these command and now after "Checking for updates.", the error is become "[CodePush] 404: {}" Can i know how to fix this?

alexandergoncharov-zz commented 6 years ago

@tlweiii6465, it is strange. Could you please provide test project with detailed repro steps which help me reproduce this issue? I would like to debug it.

And please provide result of your root folder with steps from my last message.

hungvu193 commented 6 years ago

I got the same problem, i fixed it by generate private.pem and public.pem in root of project. And run command : codepush release-react -a Project -d Staging -k private.pem It works

tlweiii6465 commented 6 years ago

@hungvu193 Thank for help!

@alexandergoncharov ,Hi sorry for delay and thank for help, I think i have solve this problem, This is my solution :

  1. clean xcode project with command + shift + K.
  2. upgrade ios folder with "react-native upgrade" to newest version.
  3. update react-native-code-push to newest version.
  4. link and setup react-native-code-push again.
  5. and now it just work fine in both OS and it can work fine with not generate private key.

Hope mine, @hungvu193 and @alexandergoncharov 's solution can help other who meet this problem too. i'll close this issue and feel free to reopen if need!

param-finder commented 2 years ago

I wasted days on this issue only to realise that I had to provide private pem key in the appcenter release react command. The documentation needs to be updated.

Steve-Rynjah commented 1 year ago

I wasted days on this issue only to realise that I had to provide private pem key in the appcenter release react command. The documentation needs to be updated.

Where do I have to place this private pem key? Specifically inside the project structure?

Steve-Rynjah commented 1 year ago

Hi @tlweiii6465 , Sorry for this delay!

It is looks like to CodePush try to install release on device with enabled sign feature but your release wasn't signed. So, CodePush prevent installing this release. For use sign feature you should add add private key for all releases. So your command should looks like so: appcenter codepush release-react -a Project-ios -d Staging -k private.pem

Please let me know if it was helpful or you have any questions.

Thanks, Alexander

@alexandergoncharov-zz Where do I have to place this private pem key? Specifically inside the project structure?