首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >解析失败: com.google.android.gms:play-services

解析失败: com.google.android.gms:play-services
EN

Stack Overflow用户
提问于 2018-11-13 07:03:45
回答 2查看 4.5K关注 0票数 0

控制台中显示以下错误消息。无法解析: com.google.android.gms:play-services:15.0.1安装存储库和同步项目在文件中显示在项目结构对话框中显示

另外,如果我尝试安装存储库,我会遇到以下问题:找不到依赖项"com.google.android.gms:play-services:15.0.1

Gradle文件如下:

代码语言:javascript
运行
AI代码解释
复制
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
apply plugin: 'org.sonarqube'
android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "fsit.luvder"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 3
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    defaultConfig {

        // Enabling multidex support.
        multiDexEnabled true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'

        exclude 'error_prone/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
    }


    sonarqube {
        properties {
            property "sonar.projectName", "Kairos"
            property "sonar.projectKey", "Luvder"
            property "sonar.sources","src/main/java"
            property "sonar.language","java"
            property "sonar.sourceEncoding", "UTF-8"
        }
    }


}

dependencies {
    implementation 'com.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.firebase:firebase-messaging:17.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
    implementation 'com.google.firebase:firebase-perf:16.0.0'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation project(':drawer')
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
    implementation 'com.google.android.gms:play-services-auth:15.0.1'
    implementation 'com.google.android.gms:play-services:15.0.1'
    implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.intuit.sdp:sdp-android:1.0.3'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.joooonho:selectableroundedimageview:1.0.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.roughike:bottom-bar:1.2.1'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'
    implementation 'com.longtailvideo.jwplayer:jwplayer-core:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-common:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-ima:+'
    // Only required if using IMA features
    implementation 'com.longtailvideo.jwplayer:jwplayer-chromecast:+'
    // Only required if using Chromecast
    testImplementation 'junit:junit:4.12'
    implementation 'com.google.android.gms:play-services:15.0.'
    implementation 'com.github.ozodrukh:CircularReveal:1.0.4'
    implementation 'me.relex:circleindicator:1.2.2@aar'
}







configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}

apply plugin: 'jacoco'
jacoco {
    version "0.7.1.201405082137"
}


jacoco {
    toolVersion "0.7.1.201405082137"
}

def coverageSourceDirs = [
        'src/main/java',
]

task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
    group = "Reporting"
    description = "Generate Jacoco coverage reports after running tests."
    reports {
        xml.enabled = true
        html.enabled = true
    }
    classDirectories = fileTree(
            dir: './build/intermediates/classes/debug',
            excludes: ['**/R*.class',
                       '**/*$InjectAdapter.class',
                       '**/*$ModuleAdapter.class',
                       '**/*$ViewInjector*.class'
            ])
    sourceDirectories = files(coverageSourceDirs)
    executionData = files("$buildDir/jacoco/testDebug.exec")
    doFirst {
        new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
            if (file.name.contains('$$')) {
                file.renameTo(file.path.replace('$$', '$'))
            }
        }
    }
}
apply plugin: 'com.google.gms.google-services'

编辑:我有一个新问题,如下所示:库com.google.android.gms:play-services-base在[15.0.1,15.0.1]上被其他各种库请求,但解析到16.0.1。禁用该插件,并使用./gradlew :app:dependencies检查依赖关系树。

更新:仍然面临编辑中提到的相同问题,即使在遵循了advance.Seeking中的responses.Thanks之后,您的专业知识也是如此。

目前我的app gradle文件如下:

代码语言:javascript
运行
AI代码解释
复制
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
apply plugin: 'org.sonarqube'


android {
    compileSdkVersion 27
    buildToolsVersion '28.0.3'
    defaultConfig {
        applicationId "fsit.luvder"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 3
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    defaultConfig {

        // Enabling multidex support.
        multiDexEnabled true
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
        exclude 'META-INF/rxjava.properties'

        exclude 'error_prone/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
    }


    sonarqube {
        properties {
            property "sonar.projectName", "Kairos"
            property "sonar.projectKey", "Luvder"
            property "sonar.sources","src/main/java"
            property "sonar.language","java"
            property "sonar.sourceEncoding", "UTF-8"
foo/Foo.java"
        }
    }



}

dependencies {
    implementation 'com.google.firebase:firebase-messaging:16.0.1'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
    implementation 'com.google.firebase:firebase-perf:16.0.1'
    implementation "com.google.firebase:firebase-auth:16.0.1"
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    implementation project(':drawer')
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.android.support:design:27.0.2'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.facebook.android:facebook-android-sdk:4.30.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    implementation 'com.google.android.gms:play-services-maps:16.0.0'

    implementation 'com.android.support:multidex:1.0.2'
    implementation 'com.android.support:recyclerview-v7:27.0.2'
    implementation 'com.github.barteksc:android-pdf-viewer:2.0.3'
    implementation 'com.mcxiaoke.volley:library-aar:1.0.0'
    implementation 'com.android.support:support-v4:27.0.2'
    implementation 'com.intuit.sdp:sdp-android:1.0.3'
    implementation 'com.android.support:cardview-v7:27.0.2'
    implementation 'com.joooonho:selectableroundedimageview:1.0.1'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.roughike:bottom-bar:1.2.1'
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.1.+'
    implementation 'com.github.ybq:Android-SpinKit:1.1.0'
    implementation 'com.longtailvideo.jwplayer:jwplayer-core:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-common:+'
    implementation 'com.longtailvideo.jwplayer:jwplayer-ima:+'
    // Only required if using IMA features
    implementation 'com.longtailvideo.jwplayer:jwplayer-chromecast:+'
    // Only required if using Chromecast
    testImplementation 'junit:junit:4.12'
    //implementation 'com.google.android.gms:play-services:16.0.1'
    implementation 'com.github.ozodrukh:CircularReveal:1.0.4'
    implementation 'me.relex:circleindicator:1.2.2@aar'
}






configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}


apply plugin: 'jacoco'

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true


jacoco {
    version "0.7.1.201405082137"
}


jacoco {
    toolVersion "0.7.1.201405082137"
}

def coverageSourceDirs = [
        'src/main/java',
]

task jacocoTestReport(type: JacocoReport, dependsOn: "testDebugUnitTest") {
    group = "Reporting"
    description = "Generate Jacoco coverage reports after running tests."
    reports {
        xml.enabled = true
        html.enabled = true
    }
    classDirectories = fileTree(
            dir: './build/intermediates/classes/debug',
            excludes: ['**/R*.class',
                       '**/*$InjectAdapter.class',
                       '**/*$ModuleAdapter.class',
                       '**/*$ViewInjector*.class'
            ])
    sourceDirectories = files(coverageSourceDirs)
    executionData = files("$buildDir/jacoco/testDebug.exec")
    doFirst {
        new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
            if (file.name.contains('$$')) {
                file.renameTo(file.path.replace('$$', '$'))
            }
        }
    }
}
apply plugin: 'com.google.gms.google-services'

我的gradle项目如下所示:

//顶级构建文件,可以添加所有子项目/模块通用的配置选项。

代码语言:javascript
运行
AI代码解释
复制
buildscript {
    repositories {
        google()

        mavenCentral()
        maven { url "https://jitpack.io"

        }
        maven {
            url 'https://maven.fabric.io/public'
        }
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }

        maven {
            url "https://plugins.gradle.org/m2/"
        }

        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.1.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'

        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.0'
        classpath 'com.google.firebase:firebase-plugins:1.1.5'
        classpath 'io.fabric.tools:gradle:1.25.4'
        classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.1"


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

def isReleaseBuild() {
    return version.contains("SNAPSHOT") == false
}


allprojects {
    repositories {
        google()

        maven { url "https://jitpack.io" }
        maven {
            url 'https://mvn.jwplayer.com/content/repositories/releases/'
        }
        maven {
            url 'https://maven.google.com/'
        }
        jcenter()

    }
}

ext {
    sdk = 25
    buildTools = "24.0.2"
    minSdk = 14
    libraryVersion = "1.0.4"
    supportVersion = "25.0.0"
}


task clean(type: Delete) {
    delete rootProject.buildDir
}
task wrapper(type: Wrapper) {
    gradleVersion = '2.13'
    distributionUrl = "https://services.gradle.org/distributions/gradle-${gradleVersion}-all.zip"
}
apply plugin: 'android-reporting'
EN

回答 2

Stack Overflow用户

发布于 2018-11-13 08:02:07

我看到没有15.0.1发布的版本。

请在此处查看发行说明

https://developers.google.com/android/guides/releases

票数 1
EN

Stack Overflow用户

发布于 2018-11-13 11:30:28

libraries

  • Check
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53275539

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档