【问题标题】:Facing problems while Migrating to the New Places SDK迁移到 New Places SDK 时遇到的问题
【发布时间】:2019-03-21 17:54:45
【问题描述】:

当我尝试迁移到 New Places SDK 并添加新的位置依赖项时,如下所示:

implementation 'com.google.android.libraries.places:places:1.0.0'

它为其他依赖项提供了很多错误,如下所示。

无法解析 ':app@debug/compileClasspath' 的依赖关系:可以 无法解析 com.github.bumptech.glide:glide:4.3.1。

无法解析 ':app@debug/compileClasspath' 的依赖关系:可以 无法解析 com.google.code.gson:gson:2.8.5。

无法解析 ':app@debug/compileClasspath' 的依赖关系:可以 无法解析 com.mcxiaoke.volley:library:1.0.19。

无法解析 ':app@debug/compileClasspath' 的依赖关系:可以 无法解析 com.github.bumptech.glide:glide:4.3.1。

我收到 40 错误,如上。

当我删除地方库项目工作正常时。

我的应用级gradel文件依赖如下:

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    compile 'com.android.support:multidex:1.0.1'
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.1@aar') {
        transitive = true;
    }
    implementation 'com.facebook.android:facebook-android-sdk:4.1.0'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-annotations:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.jakewharton:butterknife:7.0.1'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.android.libraries.places:places:1.0.0'
    implementation 'com.google.guava:guava-collections:r03'
    implementation 'com.etsy.android.grid:library:1.0.5'
    implementation 'com.wdullaer:materialdatetimepicker:2.5.0'
    implementation 'com.google.firebase:firebase-messaging:17.4.0'
    implementation 'com.google.firebase:firebase-core:16.0.8'
    implementation 'com.daimajia.numberprogressbar:library:1.2@aar'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.mcxiaoke.volley:library:1.0.19'
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
    implementation 'org.apache.httpcomponents:httpcore:4.4.5'
    implementation 'org.apache.httpcomponents:httpclient:4.5'
    compile project(':mediapicker')
    //compile project(':linkedin-sdk')
    compile project(':sinch-android-rtc-3.11.1')
}

我的项目级Greadle文件如下:

buildscript {
    repositories {
        jcenter()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:4.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        google()
        maven {
            url 'https://maven.google.com/'
        }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

我在两天前就遇到了这个错误,请给出一些解决方案。

【问题讨论】:

    标签: android android-gradle-plugin build.gradle


    【解决方案1】:

    如下更新您的项目级依赖项:

    classpath 'com.android.tools.build:gradle:3.3.0'
    classpath 'com.google.gms:google-services:4.1.0'
    

    并更新您的应用级别依赖项,如下所示:

    implementation 'com.github.bumptech.glide:glide:4.9.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
    

    不要忘记在您的应用级 gradle 末尾添加“apply plugin: 'com.google.gms.google-services'”

    如果还是不行,那么你必须做如下:

    //exclude glide coming from place api
    implementation ('com.google.android.libraries.places:places:1.0.0'){
        exclude module: 'glide'
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-01-16
      • 1970-01-01
      • 2019-11-02
      • 2015-12-04
      • 1970-01-01
      • 1970-01-01
      • 2019-04-16
      相关资源
      最近更新 更多