【问题标题】:Flavors - No matching client found for package name [duplicate]风味 - 找不到与包名称匹配的客户端 [重复]
【发布时间】:2019-01-13 09:34:52
【问题描述】:

我的Gradle 如下:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath "io.fabric.tools:gradle:1.+"
    }

}



repositories {
    mavenCentral()
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    maven { url 'https://maven.fabric.io/public' }
}
android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        flavorDimensions "universal"
        minSdkVersion 14
        targetSdkVersion 27
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors
            {
                universal
                        {
                            versionCode 1700
                            versionName "1.7.0"
                            applicationId "ir.me.project"

                            resValue "string", "app_name", "name"
                            resValue "string", "launcher_name", "othername"
                        }
            }

}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:cardview-v7:27.1.1'

    implementation 'com.devbrackets.android:exomedia:2.5.6'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'

    implementation 'com.squareup.okhttp3:okhttp:3.2.0'
    implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.google.firebase:firebase-messaging:10.2.1'
    implementation 'com.github.paolorotolo:appintro:4.0.0'
    implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
    implementation('com.crashlytics.sdk.android:crashlytics:2.5.7@aar')
            {
                transitive = true;
            }
}

这是我的三个项目:

但是得到我下面的错误:

No matching client found for package name 'ir.me.project'

【问题讨论】:

    标签: android android-gradle-plugin android-studio-3.0 android-flavors


    【解决方案1】:

    通过将applicationId 作为包名称再次创建您的google-services.json。 根据您的 gradle 文件,您的 applicationIdir.me.project

    【讨论】:

      【解决方案2】:

      我认为您应该为每个应用程序 id 设置单独的 google-services.json 并使用风味创建并将它们添加到风味文件夹根文件夹中

      例如,如果您有一个应用程序 ID A 的风格,那么您应该为该风格创建带有 A 包名称的 googlre-services.json

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-06-19
        • 1970-01-01
        • 2020-10-19
        • 1970-01-01
        • 2021-10-08
        • 2018-06-14
        相关资源
        最近更新 更多