【发布时间】:2018-09-26 23:49:13
【问题描述】:
我正在尝试在同一设备上同时安装调试版本和发布版本,因此尝试将 applicationIdSuffix 添加到 gradle 文件的 buildTypes 块中,如文档中所述。没有提到要创建任何包,而是说找不到包错误。请帮忙。
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
【问题讨论】:
标签: android gradle android-gradle-plugin android-productflavors