gpt4 book ai didi

Android buildTypes 多种 Debug模式

转载 作者:行者123 更新时间:2023-11-29 14:26:34 30 4
gpt4 key购买 nike

我有三种构建类型,我试图让 staging 构建类型运行,但我收到以下错误:

Error: The apk for your currently selected variant (app-staging-unsigned.apk) is not signed. Please specify a signing configuration for the variant (staging).

有没有办法让我在不签名的情况下运行staging,就像第二次调试一样?

android {
buildTypes {
debug {
buildConfigField "String", "SERVER", '"dev.gamesmart.com"'
}
staging {
buildConfigField "String", "SERVER", '"staging.gamesmart.com"'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "SERVER", '"gamesmart.com"'
}
}
}

最佳答案

尝试:

android {
buildTypes {
debug {
buildConfigField "String", "SERVER", '"dev.gamesmart.com"'
}

staging.initWith(buildTypes.debug)

staging {
buildConfigField "String", "SERVER", '"staging.gamesmart.com"'
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "String", "SERVER", '"gamesmart.com"'
}
}
}

这表示“让 staging 开始作为 debug 的克隆,然后我们将从那里进行修改”,所以 staging 应该应用调试 签名配置。

关于Android buildTypes 多种 Debug模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41226020/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com