gpt4 book ai didi

android - 使用 gradle buildTypes 的 android 的不同 Apks

转载 作者:太空狗 更新时间:2023-10-29 13:49:30 24 4
gpt4 key购买 nike

我正在尝试在同一台设备上同时安装调试版和发布版,因此尝试在文档中提到的 gradle 文件的 buildTypes block 中添加 applicationIdSuffix。没有提到创建任何包,而是说找不到包错误。请帮忙。

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

def versionMajor = 1
def versionMinor = 0
def versionPatch = 4
def versionBuild = 0

android {
compileSdkVersion 26
defaultConfig {
applicationId "com.edu.gcfapp"
minSdkVersion 21
targetSdkVersion 26
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
javaCompileOptions {
annotationProcessorOptions {
arguments = ["room.schemaLocation": "$projectDir/schemas".toString()]
}
}
}
buildTypes {

debug {
applicationIdSuffix ".debug"
}

release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
flavorDimensions "default"

我得到的错误是这个..

Error:FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDevDebugGoogleServices'.
> No matching client found for package name 'com.edu.gcfapp.debug'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 9s

最佳答案

虽然您在 gradle 中省略了它,但看起来您正在使用 Google 服务。

您的 google 配置文件(我认为是 google-services.json 文件)不包含 com.edu.gcfapp.debug 的任何配置信息

返回到您的谷歌控制台,为您的发布和调试包名称创建一个文件,并将它们放在相关的构建文件夹中。

关于android - 使用 gradle buildTypes 的 android 的不同 Apks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49870852/

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