0

I am getting error when I am adding the Google places new library

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

I tried all these solutions from this question.

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'
]

Need to sync project with new Google Places SDK

double-beep
  • 5,031
  • 17
  • 33
  • 41

2 Answers2

1

As your using one signal it is using an old version of 12.0.1 firebase and gms library's for this you need to add a resolution Strategy to convert to the required version

You can delete this from your build.gradle file as firebase-messaging is used in other library:

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

Use this in your app build.gradle file and update google service version to 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'
        }
    }
}

I have tried with only above dependencies. I have not added all other dependencies which you're using in the app

You can analyze the app dependencies and see like which version libraries are using use below command in Android studio terminal

 ./gradlew app:dependencies
Sunil Kumar
  • 468
  • 5
  • 12
0

Try adding a different version like 16.0.9 or the latest dependency of firebase, that worked for me.

  • i tried all possible cases like new version like 17.0.0 and aslo tried 16.0.9 and older versions also not able to sync project – Shreedhar A Jul 17 '19 at 11:37