本文介绍了错误:多个库的软件包名称为"com.google.android.gms.license"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

今天,我打开了Android Studio,然后出现此错误.昨天没有问题!

Today, I opened Android Studio, then I get this error. Yesterday, there was a no problem such that!

错误:多个库的软件包名称为'com.google.android.gms.license'

Error: more than one library with package name 'com.google.android.gms.license'

com.google.android.gms:play-services-xxx库为

com.google.android.gms:play-services-xxx libraries was

11.8.0

Onesignal库为

Onesignal library was

'com.onesignal:OneSignal:[ 3.6.2 ,3.99.99]'

'com.onesignal:OneSignal:[3.6.2, 3.99.99]'

然后我将它们更改为最新版本.

Then I changed them to latest version.

现在的应用/等级:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "xxx.xxx.xxx"
        minSdkVersion 15
        targetSdkVersion 24
        versionCode 10
        versionName 'x.x.x'
        manifestPlaceholders = [onesignal_app_id: "xxxxx-xx-xxx",
                                // Project number pulled from dashboard, local value is ignored.
                                onesignal_google_project_number: "XXX"]

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
}

repositories {
    maven { url 'https://maven.google.com' }
}


dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.mcxiaoke.volley:library:1.0.18'
    compile 'com.github.chrisbanes.photoview:library:1.2.3'
    compile 'com.facebook.android:facebook-android-sdk:4.0.1'
    compile 'com.google.android.gms:play-services-ads:12.0.0'

    //compile 'com.google.android.gms:play-services-ads:11.2.2'

    compile 'com.pkmmte.view:circularimageview:1.1'
    compile 'com.melnykov:floatingactionbutton:1.3.0'
    compile 'com.squareup.okhttp:okhttp:2.5.0'
    compile 'com.github.bumptech.glide:glide:3.7.0'
    //compile 'com.android.support:appcompat-v7:26.1.0'

    compile 'com.android.support:appcompat-v7:27.1.0'
    compile 'com.android.support:cardview-v7:27.1.0'
    compile 'com.android.support:recyclerview-v7:27.1.0'
    compile 'com.android.support:design:27.1.0'
    compile 'com.balysv:material-ripple:1.0.2'
    compile "com.google.firebase:firebase-messaging:12.0.0"
    compile 'com.github.hotchemi:android-rate:1.0.1'
    compile 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
    compile 'com.google.android.gms:play-services-analytics:12.0.0'
}

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

项目/成绩:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.3'

        classpath 'com.google.gms:google-services:3.1.1'

      //  classpath 'com.google.gms:google-services:3.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

但是我仍然收到与上述相同的错误.我怎么解决这个问题?为什么昨天没有问题的今天发生了这个问题?

But I am still getting same error that stated above. How can I solve this problem? Why did this problem occur Today when there was no problem, yesterday?

推荐答案

这可能是因为播放服务版本不在为以下内容定义的范围内 OneSignal:[3.7.1、3.99.99] (您可以在此提交):

This probably because the play services version is not in the range defined for OneSignal:[3.7.1, 3.99.99] which is (you can see it at this commit):

// Limit upper number (exclusive) to prevent untested versions
static def versionGroupOverrides = [
    'com.google.android.gms': '[10.2.1, 11.7.0)',
    'com.android.support': '[26.0.0, 27.1.0)'
]

因此,请尝试将播放服务版本更改为 11.7.0 .

So, try changing the play services version to 11.7.0.

您应该尝试使用 OneSignal Gradle插件,它有助于使OneSignal Android SDK兼容与您的Android Studio项目一起使用.将OneSignal-Gradle-Plugin 0.8.0 用于 OneSignal:[3.7.1,3.99.99]

You should try using OneSignal Gradle Plugin which helps make the OneSignal Android SDK compatible with your Android Studio project. Use OneSignal-Gradle-Plugin 0.8.0 for OneSignal:[3.7.1, 3.99.99]

这篇关于错误:多个库的软件包名称为"com.google.android.gms.license"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-22 07:25