0

添加 Google 地方新库时出现错误

实施 'com.google.android.libraries.places:places:1.1.0'

我从这个问题尝试了所有这些解决方案。

dependencies {
    compileOnly 'org.glassfish:javax.annotation:10.0-b28'
    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('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
        transitive = true;
    }
    implementation project(path: ':calendar')
    implementation 'com.google.firebase:firebase-core:11.0.4'
    implementation 'com.google.firebase:firebase-messaging:11.0.4'
    implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.8.6'
    implementation 'com.onesignal:OneSignal:[3.6.2, 3.99.99]'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.volley:volley:1.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.google.android.gms:play-services-maps:11.0.4'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.android.gms:play-services-location:11.0.4'
    implementation 'com.google.android.gms:play-services-places:11.0.4'
    implementation 'com.google.android.gms:play-services-base:11.0.4'
    implementation 'com.google.android.gms:play-services-identity:11.0.4'
    implementation 'com.google.android.gms:play-services-auth-api-phone:11.0.4'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'com.baoyz.pullrefreshlayout:library:1.2.0'
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation 'com.daimajia.easing:library:2.0@aar'
    implementation 'com.daimajia.androidanimations:library:2.2@aar'
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'me.relex:circleindicator:1.2.2@aar'
    implementation 'com.github.bumptech.glide:glide:3.7.0'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.github.applikeysolutions:cosmocalendar:1.0.4'
    implementation 'com.google.maps.android:android-maps-utils:0.4.4'
    implementation 'com.android.support:multidex:1.0.0'
    implementation 'com.hbb20:ccp:2.2.2'
    implementation 'com.github.GoodieBag:Pinview:v1.3'
    implementation 'com.crystal:crystalrangeseekbar:1.0.0'
    implementation 'com.github.douglasjunior.BetterSpinner:library:bugfix-1.1.0-2'
    implementation 'com.github.mabbas007:TagsEditText:1.0.5'
    implementation 'com.github.vihtarb:tooltip:0.1.9'
    implementation 'com.github.warkiz:IndicatorSeekBar:v1.2.1'
    implementation 'uk.co.chrisjenx:calligraphy:2.3.0'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'com.github.broakenmedia:MultiContactPicker:1.7'
    testImplementation 'junit:junit:4.12'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.15'
    implementation 'com.jakewharton:butterknife:8.8.1'
    implementation 'com.google.code.gson:gson:2.8.5'
    implementation 'com.dc.easyadapter:easyadapter:2.0.3'
    implementation 'com.jakewharton.rxbinding2:rxbinding:2.1.1'
    kapt 'com.jakewharton:butterknife-compiler:8.8.1'
    implementation 'com.jakewharton.timber:timber:4.5.1'
    implementation 'com.google.dagger:dagger:2.19'
    annotationProcessor 'com.google.dagger:dagger-compiler:2.19'
    implementation 'com.google.dagger:dagger-android:2.19'
    implementation 'com.google.dagger:dagger-android-support:2.19'
    implementation 'com.andrognito.flashbar:flashbar:1.0.2'
    implementation 'com.laimiux.rxnetwork:rxnetwork:0.0.4'
    debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
    debugINImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
    debugDEImplementation 'com.squareup.leakcanary:leakcanary-android:1.6.2'
    releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
    stagingImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.6.2'
    implementation 'android.arch.persistence.room:runtime:1.1.1'
    implementation 'com.android.support:support-annotations:27.1.1'
    kapt "android.arch.persistence.room:compiler:1.1.1"
    // if you use the support libraries
    kapt 'com.google.dagger:dagger-android-processor:2.19'

}

======================================================================

buildscript {
    ext.kotlin_version = '1.3.0'
    repositories {
        google()
        repositories {
            google()
            jcenter()
            mavenCentral()
            maven { url 'https://maven.fabric.io/public' }
            maven { url 'https://plugins.gradle.org/m2/'}
        }

    }

    dependencies {
//        classpath 'com.google.gms:google-services:3.1.0'
        classpath 'com.google.gms:google-services:3.2.1'
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'io.fabric.tools:gradle:1.25.4'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {

        repositories {
            google()
            jcenter()
            maven { url "https://jitpack.io" }
            mavenCentral()
        }
    }
}

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

ext.deps = [
        // Test dependencies
        junit      : 'junit:junit:4.10',
        festandroid: 'com.squareup:fest-android:1.0.7',
        robolectric: 'org.robolectric:robolectric:2.2',
        intellijannotations: 'com.intellij:annotations:12.0'
]

需要将项目与新的 Google Places SDK 同步

4

2 回答 2

1

当您使用一个信号时,它使用的是旧版本的 12.0.1 firebase 和 gms 库,为此您需要添加一个分辨率策略以转换为所需的版本

您可以从 build.gradle 文件中删除它,因为 firebase-messaging 在其他库中使用:

implementation 'com.google.firebase:firebase-core:11.0.4'
implementation 'com.google.firebase:firebase-messaging:11.0.4'

在您的应用程序 build.gradle 文件中使用它并将 google 服务版本更新为 16.0.0

implementation 'com.applozic.communication.uiwidget:mobicomkitui:5.8.6'
implementation 'com.onesignal:OneSignal:3.11.1'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-identity:16.0.0'
implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'

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

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested

        if (requested.group == 'com.google.android.gms' && (requested.name == 'play-services-measurement-base')) {
            details.useVersion '15.0.2'  //use a common gms version here
        }

        if (requested.group == 'com.google.android.gms' && (requested.name == 'play-services-basement')) {
            details.useVersion '15.0.1'  //use a common gms version here
        }

        if(requested.group == 'com.google.firebase' && requested.name == 'firebase-messaging'){
            details.useVersion '15.0.0'
        }

        if(requested.group == 'com.google.firebase' && requested.name == 'firebase-iid'){
            details.useVersion '16.0.0'
        }

        if(requested.group == 'com.google.firebase' && requested.name == 'firebase-analytics-impl'){
            details.useVersion '15.0.2'
        }
    }
}

我只尝试了上述依赖项。我没有添加您在应用程序中使用的所有其他依赖项

您可以分析应用程序依赖项并查看哪些版本库正在使用 Android Studio 终端中的以下命令

 ./gradlew app:dependencies
于 2019-07-23T20:58:52.853 回答
0

尝试添加对我有用的其他版本,例如 16.0.9 或最新的 firebase 依赖项。

于 2019-07-17T10:48:26.433 回答