Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android Only] Error! Public key was provided but there is no JWT signature within app bundle to verify. #2141

Closed
tronginc opened this issue Sep 8, 2021 · 21 comments

Comments

@tronginc
Copy link

tronginc commented Sep 8, 2021

It works on IOS! Same private.pem & public.pem.

Expected Behavior

What you expected to happen?

Actual Behavior

After download and extract the bundle's content:
image

I got this 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.

Step

  • Key generation
# generate private RSA key and write it to private.pem file
openssl genrsa -out private.pem

# export public key from private.pem into public.pem
openssl rsa -pubout -in private.pem -out public.pem
appcenter codepush release-react \
     -a MyCompany/MyApp \
     -d Staging \
     -k private.pem \
     -m --description "Release a test update"

Environment

  • react-native-code-push version: 7.0.2
  • react-native version: 0.64.1
  • iOS/Android/Windows version: Android 11, Windows 10
  • Does this reproduce on a debug build or release build? Debug and Release
  • Does this reproduce on a simulator, or only on a physical device? All
@immutable-pro
Copy link

I have started observing exactly the same issue, Android Only, just today.

@vishal-android-freak
Copy link

Facing the same isssue

@immutable-pro
Copy link

The exception is:

[CodePush] Exception
com.microsoft.codepush.react.CodePushInvalidUpdateException: 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.
	at com.microsoft.codepush.react.CodePushUpdateManager.downloadPackage(CodePushUpdateManager.java:279)
	at com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:290)
	at com.microsoft.codepush.react.CodePushNativeModule$3.doInBackground(CodePushNativeModule.java:284)
	at android.os.AsyncTask$3.call(AsyncTask.java:394)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
	at java.lang.Thread.run(Thread.java:923)

The generated signature path is:

signaturePath /data/user/0/[app]/files/CodePush/116f592802ca60efc8aae3bcad609d793b33145c48e99ebfe8bcbf4b1f9630b6/CodePush/.codepushrelease

@immutable-pro
Copy link

This change is very suspicious...
v7.0.1...v7.0.2

@immutable-pro
Copy link

I can confirm that locking react-native-code-push" to "7.0.1" fixes the issue.

@wijskinner
Copy link

wijskinner commented Sep 10, 2021

This is actually extra annoying as as far as I can see the fix itself can't be code-pushed. 🙃

The knock on effect of this is me having to force my android users to upgrade to a new full play store release to ever get code push working for them. Bit of a nightmare. Feel like we need a big warning somewhere about this release.

@regalstreak
Copy link

Confirmed. 7.0.2 is a non working release for Android. Downgraded to 7.0.1 and it worked like it used to

@felipeaugusto1
Copy link

I'm using 7.0.1 with React Native 0.65.1 and it's not working

@immutable-pro
Copy link

Hi @felipeaugusto1. According to the documentation at https://github.com/microsoft/react-native-code-push#supported-react-native-platforms 0.65.x requires 7.2+. So I am afraid you will have to wait until this bug gets fixed, if you can't downgrade your RN version.

@felipeaugusto1
Copy link

I didn't notice that @immutable-pro . Thank you for the info

@felipeaugusto1
Copy link

I was able to get the 7.0.3 version working with react-native 0.65.1. Just had to downgrade com.android.tools.build:gradle to 4.0.1

@gabimoncha
Copy link

Neither 7.0.2 or 7.0.3 solves this issue.

@wemmarcovecchio
Copy link

I have the same issue. I downgrading Code push version from 7.0.3 to 7.0.1, Neither 7.0.2 or 7.0.3 solves this issue.

Environment
react-native-code-push version: 7.0.1
react-native version: 0.65.1
Android version: Android 11
Does this reproduce on a debug build or release build? Debug and Release
Does this reproduce on a simulator, or only on a physical device? All

@wemmarcovecchio
Copy link

Confirmed. 7.0.2 is a non working release for Android. Downgraded to 7.0.1 and it worked like it used to

Which version of react-native are you using?

@gabimoncha
Copy link

I've tested it on 0.64.2

@chirag-jain-furlenco
Copy link

chirag-jain-furlenco commented Nov 7, 2021

I am facing the same issue
When I build release apk from my system (v7.0.4), app is getting updated via codepush
But release apk from my colleague's system (on same branch), are not getting updated. Instead, its failing after downloading step

@snkhan120
Copy link

Problem has been solved!

Follow the steps:
1- In package.json change version of "react-native-code-push" "^7.0.1" to "^7.0.4",
2- Delete node_modules folder
3- npm install or yarn install
4- npm install --package-lock-only

[CodePush] Reporting binary update (2.2.1)
LOG [CodePush] Awaiting user action.
LOG [CodePush] Downloading package.
LOG [CodePush] Installing update.

@ghost ghost added the stale label Jan 10, 2022
@ghost
Copy link

ghost commented Jan 10, 2022

This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs within 15 days of this comment.

@ghost
Copy link

ghost commented Jan 26, 2022

This issue will now be closed because it hasn't had any activity for 15 days after stale. Please feel free to open a new issue if you still have a question/issue or suggestion.

@ghost ghost closed this as completed Jan 26, 2022
@casaumayman
Copy link

Screen Shot 2022-02-23 at 16 24 16
I still get this issue. Any update?

@ghost ghost removed the stale label Feb 23, 2022
@patelbansari
Copy link

I'm still facing this issue on Android. Any update?

"react-native": "0.70.3",
"react-native-code-push": "^7.0.5",

i added my CodePushPublicKey in strings.xml.
also i'm using below one to update the release in appcenter.

appcenter codepush release-react -a <ownerName>/<appName> -t 20.27.7 -d Staging -k private.pem

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests