【发布时间】:2021-11-12 05:44:18
【问题描述】:
我在 Kotlin 中创建应用程序并支付了 Google 开发者帐户。但是上传 .aab 文件存在一些问题:The Android App Bundle was not signed。我在 Stackoverflow 上阅读了所有关于它的主题并尝试了所有解决方案。不适合我。
build.gradle 中的 signingConfig signingConfigs.release 以此错误结尾:Could not get unknown property 'release' for SigningConfig。它仅在我设置signingConfig 时有效。我也在使用这个:minifyEnabled false 和 debuggable = false。那么我必须尝试什么? 2021 年有一些新的解决方案吗?!
我的 build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 31
buildToolsVersion "30.0.3"
defaultConfig {
applicationId '...'
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.00"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
manifestPlaceholders["hostName"] = "..."
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
signingConfig
debuggable = false
}
applicationVariants.all{
variant ->
variant.outputs.each{
output->
def name = "...apk"
output.outputFileName = name
}
}
}
buildFeatures{
dataBinding = true
viewBinding = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.navigation:navigation-fragment-ktx:2.3.5'
implementation 'com.github.amitshekhariitbhu.Fast-Android-Networking:android-networking:v1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
}
【问题讨论】:
-
这有帮助吗 - link
-
谢谢,但这正是我正在做的。
-
你能在课堂上添加你的构建类型吗? build.gradle
-
我编辑了我原来的问题。再次感谢!
标签: android kotlin build.gradle bundle signed