我已经编写了一个Android应用程序,但是发布过程的最后一步仍然让我望而却步。我假设当我运行gradle bundleRelease时,它将生成我可以上传到Play商店的aab文件。但Play商店表示该 bundle 未签名。但是,构建过程表示正在签名:
> Task :app:preBuild UP-TO-DATE
> Task :app:preReleaseBuild UP-TO-DATE
> Task :app:compileReleaseRenderscript NO-SOURCE
> Task :app:generateReleaseResValues UP-TO-DATE
> Task :app:generateReleaseResources UP-TO-DATE
> Task :app:mergeReleaseResources UP-TO-DATE
> Task :app:checkReleaseManifest UP-TO-DATE
> Task :app:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :app:mainApkListPersistenceRelease UP-TO-DATE
> Task :app:processReleaseManifest UP-TO-DATE
> Task :app:bundleReleaseResources UP-TO-DATE
> Task :app:checkReleaseDuplicateClasses UP-TO-DATE
> Task :app:mergeExtDexRelease UP-TO-DATE
> Task :app:compileReleaseAidl NO-SOURCE
> Task :app:generateReleaseBuildConfig UP-TO-DATE
> Task :app:prepareLintJar UP-TO-DATE
> Task :app:generateReleaseSources UP-TO-DATE
> Task :app:javaPreCompileRelease UP-TO-DATE
> Task :app:processReleaseResources UP-TO-DATE
> Task :app:compileReleaseJavaWithJavac UP-TO-DATE
> Task :app:transformClassesWithDexBuilderForRelease UP-TO-DATE
> Task :app:mergeDexRelease UP-TO-DATE
> Task :app:mergeReleaseShaders UP-TO-DATE
> Task :app:compileReleaseShaders UP-TO-DATE
> Task :app:generateReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseAssets UP-TO-DATE
> Task :app:mergeReleaseJniLibFolders UP-TO-DATE
> Task :app:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
> Task :app:processReleaseJavaRes NO-SOURCE
> Task :app:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
> Task :app:buildReleasePreBundle UP-TO-DATE
> Task :app:collectReleaseDependencies UP-TO-DATE
> Task :app:configureReleaseDependencies UP-TO-DATE
> Task :app:packageReleaseBundle UP-TO-DATE
> Task :app:signingConfigWriterRelease UP-TO-DATE
> Task :app:signReleaseBundle
> Task :app:bundleRelease
gradle构建脚本中有一个签名部分:
android {
...
signingConfigs {
release {
storeFile file(...)
storePassword '...'
keyAlias '...'
keyPassword '...'
}
}
如果我在运行构建之前删除了所有aab文件,则会在以下位置生成一个app.aab
..\app\build\outputs\bundle\release
似乎一切井井有条,除了Play商店不接受aab之外:
The Android App Bundle was not signed.
我如何建立可释放的aab?
最佳答案
如果有人仍在寻找解决方案-在发布配置中将debuggable设置为false。您的应用程序构建gradle文件应具有以下内容-
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
debuggable = false
}
}