gpt4 book ai didi

android - Gradle 看不到产品 flavor 。我怎样才能添加它们?

转载 作者:行者123 更新时间:2023-12-03 04:25:16 25 4
gpt4 key购买 nike

当我尝试为我的项目添加 flavor 时,Gradle 根本不想同步,即使我同步它,我也无法在 Build Variats 中看到 flavor 。什么会导致这个问题?该项目有几个模块,我需要为应用程序添加 flavor 。我的文件:

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

buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}

dependencies {
classpath 'io.fabric.tools:gradle:1.24.4'
}
}

repositories {
maven { url 'https://maven.fabric.io/public' }
}


def keystorePropertiesFile = "${rootDir}${File.separator}keystore.properties" as File

keystoreProperties.load(new FileInputStream(keystorePropertiesFile))

android {

dexOptions {
javaMaxHeapSize "4g"
}

compileSdkVersion 25
buildToolsVersion "25.0.3"

defaultConfig {
applicationId ""
minSdkVersion 21
targetSdkVersion 25
versionCode 9999
versionName "17.2 (9999)"
}

productFlavors {
testFlavor {
applicationId "com.volodymyr.mobiletest"
}
}

def keystoreFilePath = "${System.properties['user.home']}${File.separator}${keystoreProperties['storeFile']}"
signingConfigs {
config {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreFilePath)
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
release {

}
debug {

}
}
splits {
abi {
enable true
reset()
include 'armeabi-v7a', 'arm64-v8a'//, 'x86', 'x86_64'
universalApk true
}
}

lintOptions {
lintConfig file("lint.xml")

check "WrongConstant"
abortOnError true
}
}

tasks.whenTaskAdded { task ->
if(task.name.equals("assembleDebug")){
task.dependsOn(lint)
}
}
dependencies {
}

我从这里删除了一些信息,比如依赖项、id 等,只是为了显示一个结构。

最佳答案

Error:(15, 0) ProductFlavor names cannot start with 'test'



您应该使用另一个 flavor 名称

关于android - Gradle 看不到产品 flavor 。我怎样才能添加它们?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47092196/

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