5

My Gradle is like bellow:

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;
            }
}

And here is my three project: enter image description here

But get me bellow error:

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

2 Answers2

5

Create your google-services.json again by giving the applicationId as the package name. According to your gradle file, your applicationId is ir.me.project

Muhammad Muzammil
  • 864
  • 1
  • 9
  • 24
1

i think you should have separate google-services.json per application id which you want create with flavor and add them inside the flavor folder root folder

for example if you have one flavor whit the applicationId A then your should create the googlre-services.json with the package name of A for that flavor

Amir Hossein Mirzaei
  • 1,592
  • 1
  • 6
  • 15