gpt4 book ai didi

android - 错误 :Flavor 'fdroid' has no flavor dimension

转载 作者:行者123 更新时间:2023-11-29 01:01:00 28 4
gpt4 key购买 nike

我收到类似 Error: Flavor 'fdroid' has no flavor dimension 这样的错误。将项目导入 Android Studio 后,请帮助我我在这里没有改变任何东西,它询问 fdroid 的 flavor 尺寸

我收到类似 Error: Flavor 'fdroid' has no flavor dimension 这样的错误。将项目导入 Android Studio 后,请帮助我我在这里没有改变任何东西,它询问 fdroid 的 flavor 尺寸

    apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"

flavorDimensions "default"
defaultConfig {
applicationId "com.google.android.stardroid"
minSdkVersion 15
targetSdkVersion 24
versionCode 1480
versionName "1.9.2"
buildConfigField 'String', 'GOOGLE_ANALYTICS_CODE', '""'
}
signingConfigs {
release {
if (project.file('no-checkin.properties').exists()) {
Properties properties = new Properties()
// Sky Map devs should create this file with the signing passwords
properties.load(project.file('no-checkin.properties').newDataInputStream())
storeFile file("stardroid-release-key.keystore")
storePassword properties.getProperty('store-pwd')
keyPassword properties.getProperty('key-pwd')
keyAlias "stardroid"
}
}
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
if (file('no-checkin.properties').exists()) {
signingConfig signingConfigs.release
Properties properties = new Properties()
// Sky Map devs should create this file with the Google Analytics key
properties.load(project.file('no-checkin.properties').newDataInputStream())
def analyticsKey = properties.getProperty('analytics-key')
buildConfigField 'String', 'GOOGLE_ANALYTICS_CODE', analyticsKey
}
}
}

lintOptions {
// Lint complains because of missing translations.
// TODO(jontayler): fix the missing translations.
abortOnError false
}

// This enables long timeouts required on slow environments, e.g. Travis
adbOptions {
timeOutInMs 10 * 60 * 1000 // 10 minutes
installOptions "-d", "-t"
}

productFlavors {
// includes gms Google servies
gms {
resValue "string", "analytics_enabled", "true"
}

// uses only open source software
fdroid {
resValue "string", "analytics_enabled", "false"
}
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-annotations:23.2.1'
compile 'com.google.guava:guava:19.0'
gmsCompile 'com.google.android.gms:play-services-analytics:8.4.0'
gmsCompile 'com.google.android.gms:play-services-location:8.4.0'
compile "com.android.support:support-v4:26.1.0"
compile 'com.google.dagger:dagger:2.0.2'
provided 'javax.annotation:jsr250-api:1.0' // For annotations not in Android but needed by Dagger
annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:1.10.19'
testCompile 'org.robolectric:robolectric:3.0'
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'org.easymock:easymock:2.5.2'
}

apply plugin: 'com.google.gms.google-services'

这是我的应用程序 gradle,请检查。

最佳答案

您需要添加 dimension "tier"在你的两个味道。

有关更多信息,请查看 migration guide

喜欢:

    // Specifies two flavor dimensions.
flavorDimensions "tier", "minApi"

productFlavors {
free {
// Assigns this product flavor to the "tier" flavor dimension. Specifying
// this property is optional if you are using only one dimension.
dimension "tier"
...
}

paid {
dimension "tier"
...
}

minApi23 {
dimension "minApi"
...
}

minApi18 {
dimension "minApi"
...
}
}

关于android - 错误 :Flavor 'fdroid' has no flavor dimension,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51166456/

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