- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
我正在尝试在同一台设备上同时安装调试版和发布版,因此尝试在文档中提到的 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/
我想在我的项目中配置第三个 BuildType,它继承另一个 BuildType 的所有配置。 我该怎么做? 最佳答案 只需在构建类型中使用 initWith 属性即可: uitesting {
我有两个 gradle 模块 :app (安卓应用) :data (安卓库):app取决于 :data .我创建了一个额外的 buildType对于两个名为 mock 的模块.当我构建 :app在 m
我创建了如下的自定义 buildType: buildTypes { releasefree.initWith(buildTypes.release) release
我的Android项目具有多种构建类型和productFlavors flavorDimensions "default" productFlavors { favor1
这是我的 build.gradle(Module: app) 的一部分 buildTypes { release { minifyEnabled false p
我正在使用 android 实验性插件 0.4 ( gradle 2.8 ) 并想修改与 buildType 关联的所有任务;在我的案例中进行调试。 目前,我正在使用以下“hack”: tasks.a
enter image description here 我正面临这个问题 Could not find method buildTypes() for arguments [build_3r52yu
我在buildTypes中有四个条目。它工作正常,我可以在linux终端上触发gradle build命令,在项目目录中创建8个apk文件,等等。在android studio中,我可以在构建版本之间
谁能解释buildTypes块如何在Gradle中工作? 据我所知,调试块在 Debug模式下运行,发布块在 Release模式下运行。 但是,如果我运行Gradle脚本,则这两个块都将运行! b
我无法创建使用不同 list 的两种不同构建类型。即使使用--rerun-tasks重新运行gradle并完全删除了构建目录后,apk中包含的AndroidManifest还是不正确的。例如,我运行a
我的项目gradle文件中出现此错误: 'buildTypes' cannot be applied to '(groovy.lang.Closure)' 我目前正在使用Android Studio
我正在使用以下配置: android { // a lot more of definitions... signingConfigs { // For advanced-artefacts,
BuildType 对象(Gradle Android 插件)的这两个属性有什么区别? applicationIdSuffix 和 packageNameSuffix? zipAlign 属性是什么意
我是 Gradle 构建工具的新手。我想在 Android 应用程序中创建常量 OPEN_WEATHER_MAP_API_KEY 但出现以下错误 构建.gradle `apply plugin:
我想通过以下方式区分发布和调试 buildTypes: buildTypes { release { minifyEnabled false signingC
我有三种构建类型,我试图让 staging 构建类型运行,但我收到以下错误: Error: The apk for your currently selected variant (app-stagi
我有一个 Android 应用程序,我想更改调试和其他 buildTypes 的应用程序标签。我没有任何口味! 这是我认为应该有效的设置: -src |-debug |-res
我想设置一个项目来构建两个可以安装在同一设备上的不同 apk - 其中一个是生产 apk,第二个是调试 apk。为此,我在 build.gradle 中定义了: buildTypes {
我有 2 种风格的应用程序,每种都有自己的 google maps (v1) key 用于调试和发布(意味着总共有 4 个 key )。所以我想知道我是否可以根据 buildType 和 produc
决定使用 Gradle 6.5 从 Android gradle plugin 3.5.x 切换到 gradle plugin 4.10 并坚持错误。 这是我的 build.gradle defaul
我是一名优秀的程序员,十分优秀!