简体   繁体   中英

Google Play Console signing error/invalid signature after rebuilding react-native

Our team decided to upgrade our react-native version from 0.59.x to 0.61.5. We have so many difficulty upgrading it so we decide to start a new repo from fresh (npx react-native init appName) and copy over our code.

After we make sure the app are running both on Android and ios simulator. We use the same scripts to build the .aab file and upload to Google Play Console. But Google Play Console won't let us. This is the error message shown:

Upload failed

You uploaded an APK with an invalid signature (learn more about signing). Error from apksigner:

There is no other error message after "apksigner:" so I am pretty sure it is a different problem than other similar questions on stack overflow.

I am also sure that we are using the same keystore file

Below is how we build our .aab file

curl "http://localhost:8081/index.bundle?platform=android" -o "android/app/src/main/assets/index.android.bundle"
cd $REPO_PATH/android
./gradlew bundleRelease
cd ..

# sign the aab
jarsigner -sigalg SHA1withRSA -digestalg SHA1 -keystore ~/my-release-key.keystore $REPO_PATH/android/app/build/outputs/bundle/release/app.aab traytAndroidKey

# zipalign the aab and output it to another file 
$HOME/Library/Android/sdk/build-tools/28.0.3/zipalign -f -v 4 $REPO_PATH/android/app/build/outputs/bundle/release/app.aab $REPO_PATH/android/app/build/outputs/bundle/release/app-release-signed-aligned-$VERSION_CODE.aab

Please help :(

It seems that you are uploading an AAB and not an APK. AABs don't need to be zip-aligned. Try only signing with jarsigner.

Also, try verifying the signature with jarsigner too.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM