mapiacompany / capacitor-codepush

Capacitor plugin for CodePush
http://appcenter.ms
Other
151 stars 65 forks source link

Public key was provided but there is no JWT signature within app bundle to verify #64

Open tolutronics opened 2 years ago

tolutronics commented 2 years ago

E/Capacitor/Console: File: http://localhost/vendor.js - Line 131045 - Msg: [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.. StackTrace: Error: Error! Public key was provided but there is no JWT signature within app bundle to verify. Possible reasons, why that might happen:
  3. You've been released CodePush bundle update using version of CodePush CLI that is not support code signing.
  4. You've been released CodePush bundle update without providing --privateKeyPath option. at verify (http://localhost/vendor.js:131531:32) at http://localhost/vendor.js:131573:21 at LocalPackage. (http://localhost/vendor.js:131592:17) at Generator.next () at fulfilled (http://localhost/vendor.js:131438:58) at ZoneDelegate.invoke (http://localhost/polyfills.js:436:30) at Zone.run (http://localhost/polyfills.js:196:47) at http://localhost/polyfills.js:1354:38 at ZoneDelegate.invokeTask (http://localhost/polyfills.js:470:35) at Zone.runTask (http://localhost/polyfills.js:241:51)

NOTE, I am using the latest appcenter-cli I also provided a private key path

tolutronics commented 2 years ago

Is anyone else having this issue?

alexcroox commented 2 years ago

I have the same issue, occurs after:

[CodePush] Installing update [CodePush] Applying full update

I release with the following:

appcenter codepush release --target-binary-version '^1' --app FarmTo/farmto-ios-sandbox --update-contents-path ./ios/App/App/public/ --private-key-path '/Users/alex/Documents/Keys/farmto-app/codepush-keys/private.pem' --deployment-name Production

And my capacitor config looks correct:

image

image

alexcroox commented 2 years ago

I've also noticed the docs and the error feedback reference --privateKeyPath but if you use that with codepush cli you get the error;

"Unknown argument --privateKeyPath" so consulting the docs https://docs.microsoft.com/en-gb/appcenter/distribution/codepush/cli#releasing-updates-general I used --private-key-path and it stopped complaining

alexcroox commented 2 years ago

Others in the react-native repo are having issues with this recently, wonder if related https://github.com/microsoft/react-native-code-push/issues/2141

alexcroox commented 2 years ago

The workaround for me is to not sign the release and remove the IOS_PUBLIC_KEY entry

tolutronics commented 2 years ago

@alexcroox Do you get the signing working for android?

tolutronics commented 2 years ago

I've also noticed the docs and the error feedback reference --privateKeyPath but if you use that with codepush cli you get the error;

"Unknown argument --privateKeyPath" so consulting the docs https://docs.microsoft.com/en-gb/appcenter/distribution/codepush/cli#releasing-updates-general I used --private-key-path and it stopped complaining

yes, that flag does not work but instead "-k" works

tolutronics commented 2 years ago

This issue is a serious one, that needs urgent attention

veneliniliev commented 2 years ago

i have the same problem :(

Dwimcore commented 2 years ago

Same here

LouiMinister commented 2 years ago

Same here too

veneliniliev commented 2 years ago

The workaround for me is to not sign the release and remove the IOS_PUBLIC_KEY entry

@LouiMinister use this for now. its working for me.

LouiMinister commented 2 years ago

@veneliniliev After applied your advice, JWT ERROR was solved but other error has occurred on xcode.

{"data":"OK","status":200,"url":"https:\/\/codepush.appcenter.ms\/v0.1\/public\/codepush\/report_status\/download","headers":{"Content-Length":"2","access-control-allow-methods":"POST","request-context":"appId=cid-v1:4116a8f2-fe3b-4636-b7b9-91c8df94c88d"," ERROR MESSAGE: {"message":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file."} ⚡️ [error] - {"message":"The file “hotcodepush.json” couldn’t be opened because there is no such file.","errorMessage":"The file “hotcodepush.json” couldn’t be opened because there is no such file."} ⚡️ To Native -> CodePush getPublicKey 127958629 ⚡️ [log] - [CodePush] Applying full update ERROR MESSAGE: {"message":"The file “.codepushrelease” couldn’t be opened because there is no such file.","errorMessage":"The file “.codepushrelease” couldn’t be opened because there is no such file."} ⚡️ [error] - {"message":"The file “.codepushrelease” couldn’t be opened because there is no such file.","errorMessage":"The file “.codepushrelease” couldn’t be opened because there is no such file."} ⚡️ To Native -> CodePush getAppVersion 127958632 ⚡️ To Native -> CodePush getBinaryHash 127958633 ⚡️ To Native -> CodePush isPendingUpdate 127958634 ⚡️ To Native -> CodePush getNativeBuildTime 127958636 ⚡️ To Native -> CodePush getAppVersion 127958637 ⚡️ TO JS {"uri":"file:\/\/\/var\/mobile\/Containers\/Data\/Application\/DF8D00C6-0C29-4649-B70D-76F19A14546C\/Documents\/codepush\/currentPackage.json"} ⚡️ To Native -> CodePush preInstall 127958639 ⚡️ [error] - [CodePush] Preinstall failure. Could not find start page in package.. StackTrace: CapacitorException@capacitor://localhost/vendor.js:105239:14 ⚡️ [error] - [CodePush] An error has occured while installing the package. Could not find start page in package.. StackTrace: preInstallFailure@capacitor://localhost/vendor.js:172081:46 ⚡️ [error] - [CodePush] An error occurred during sync. An error has occured while installing the package. Could not find start page in package.. StackTrace: preInstallFailure@capacitor://localhost/vendor.js:172081:46

Do you know about this? I think it is related with #21 Thx for your comment.

veneliniliev commented 2 years ago

@LouiMinister try with --update-contents-path ./www/ my project is angular/ionic based and build path is www/ in root folder

LouiMinister commented 2 years ago

@veneliniliev It works when I use -c ./ios/App/App/public on ios codepush. Thanks for your hint.

bazuka5801 commented 2 years ago

@tolutronics AppCenter React Native CodePush is good replacement, but look at these lines of code: https://github.com/microsoft/appcenter-cli/blob/f4f9b8f5d2dd0d3988977ed6efa412e3320ff141/src/commands/codepush/lib/codepush-release-command-base.ts#L114-L123

appcenter-cli will zip www to CodePush folder ignoring -c ios/app/app/public argument

I modified this cli (ignoring the lines above), you can install it with yarn global add @bazumax/appcenter-cli (after removing the original appcenter-cli)

This works as expected with signing of build

samicston commented 2 years ago

@tolutronics your solution did not work for me or am i missing something?