【发布时间】:2020-04-27 15:10:27
【问题描述】:
我们的团队决定将我们的 react-native 版本从 0.59.x 升级到 0.61.5。我们在升级它时遇到了很多困难,所以我们决定从新的 (npx react-native init appName) 开始一个新的 repo 并复制我们的代码。
在我们确保应用同时在 Android 和 ios 模拟器上运行之后。我们使用相同的脚本来构建 .aab 文件并上传到 Google Play Console。但 Google Play 控制台不会让我们这样做。这是显示的错误消息:
上传失败
您上传的 APK 签名无效(详细了解 签字)。来自 apksigner 的错误:
“apksigner:”之后没有其他错误消息,所以我很确定这是与堆栈溢出的其他类似问题不同的问题。
我也确定我们使用的是同一个密钥库文件
以下是我们如何构建 .aab 文件
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
请帮忙:(
【问题讨论】:
标签: android react-native google-play-console zipalign