3

我的应用程序中有大约 20 种不同的口味。以前它自去年以来一直运行良好,但在更新到新的 gradle 版本 4.4 后,它开始引发一个问题,即No matching client found for package name

注意:现在只有默认风味是工作文件。

请建议我解决此问题,

我已经解决了这个问题,现在错误是

Error:cannot access Hide
Error:Execution failed for task ':app:compileKissgc_customerDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.


    android {
        compileSdkVersion 26
        buildToolsVersion '26.0.2'
        defaultConfig {
            applicationId 'com.mobile.test'
            minSdkVersion 15
            targetSdkVersion 26

            multiDexEnabled true
            versionCode 46
            versionName "1"
            testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        }
        buildTypes {
            release {
                // minifyEnabled true
                false

    //            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),
    //                    'proguard-rules.pro'
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
        lintOptions {
            checkReleaseBuilds false
        }
        productFlavors {
            test{
                minSdkVersion 19
                applicationId 'com.mobile.test'
                targetSdkVersion 27
                versionCode 46
                versionName '1.0'
                flavorDimensions "default"
    //            deploy = "release|staging"
            }
            test1{
                minSdkVersion 19
                applicationId 'com.mobile.test1'
                targetSdkVersion 27
                versionCode 7777810
                versionName '1.0'
            }
}

  compile ("android.arch.persistence.room:runtime:1.0.0") {
        exclude group: 'com.android.support'
    }
    compile 'com.google.firebase:firebase-crash:12.0.1'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    compile('com.stripe:stripe-android:1.0.4@aar') {
        transitive = true;
    }

    compile 'com.android.support:appcompat-v7:26.1.0'
    compile('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
        transitive = true
    }
   // compile 'com.google.firebase:firebase-core:12.0.1'
//    compile 'com.google.android.gms:play-services:16.0.0'
    compile 'com.github.drawers:SpinnerDatePicker:1.0.6'
    compile 'info.hoang8f:android-segmented:1.0.6'
    implementation 'com.google.android.gms:play-services-wallet:16.0.0'

谢谢阿米特夏尔马

4

2 回答 2

1

在新的 gradle 版本中,必须在定义 productflavors 之前定义 flavorDimensions。如果您没有要提及的任何尺寸。然后默认情况下,您必须定义 flavorDimensions “default”

 flavorDimensions "default"
    productFlavors {
        test {
            applicationId "com.example.test"
        }

        tester {
            applicationId "com.example.tester"
        }
}
于 2018-09-18T14:21:12.000 回答
0

尺寸应在上述范围内定义,而不是在每种风味中定义

每种风味都应引用现有维度

flavorDimensions "default"
productFlavors {
            test{
                dimension "default"
                minSdkVersion 19
                applicationId 'com.mobile.test'
                targetSdkVersion 27
                versionCode 46
                versionName '1.0'
    //            deploy = "release|staging"
            }
            test1{
                dimension "default"
                minSdkVersion 19
                applicationId 'com.mobile.test1'
                targetSdkVersion 27
                versionCode 7777810
                versionName '1.0'
            }
}
于 2018-09-18T14:04:55.383 回答