0

I'm trying to migrate to new sdk client inside an application. When I tried to introduce the implementation inside my build.gradle the application throws an exception. What can I do to solve it?

What I have tried:

I have included inside build.gradle the following implementation

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

also I have tried with

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

both of them throws the following error

Unable to resolve dependency for project : Could not resolve com.android.volley:volley:1.1.1.

Is anything I can do to make it compatible? What are the changes I need to do?

Here is my build.gradle dependencies

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/volley.jar')
    implementation('de.keyboardsurfer.android.widget:crouton:1.8.1') {
        exclude group: 'com.google.android', module: 'support-v4'
        implementation 'com.google.maps.android:android-maps-utils:0.3+'
    }
    annotationProcessor 'org.parceler:parceler:1.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-analytics:16.0.7'
    implementation 'com.google.android.libraries.places:places-compat:1.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.google.code.gson:gson:2.7'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.squareup:otto:1.3.5'
    implementation 'com.squareup.picasso:picasso:2.3.2'
    annotationProcessor 'io.realm:realm-android:0.82.0-SNAPSHOT'
    implementation 'io.realm:realm-android:0.82.0-SNAPSHOT'
    implementation 'com.android.support:multidex:1.0.1'
    implementation 'org.parceler:parceler-api:1.1.1'
    implementation 'org.apache.amber:amber-oauth2-client:0.22-incubating'
    implementation 'org.apache.amber:amber-oauth2-common:0.22-incubating'
    implementation 'org.slf4j:slf4j-api:1.7.12'
}

project build.gradle

buildscript {
    repositories {
        mavenCentral()

        maven {
            url 'http://oss.jfrog.org/artifactory/oss-snapshot-local'

            }
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'

    }
}


allprojects {
    repositories {
        mavenCentral()
        maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
    }
}
Deˣ
  • 4,191
  • 15
  • 24
Liru
  • 311
  • 1
  • 4
  • 10

1 Answers1

1

Please verify if you have this repository added in your app level gradle file

allprojects {

    repositories {
         jcenter()
    }
}

Also change this line

implementation files('libs/volley.jar')

to

implementation 'com.android.volley:volley:1.1.0'

As you are facing issue Program type already present: com.android.volley.AuthFailureError

Add this in your app dir build.gradle

android{
configurations {
    all*.exclude group: 'com.android.volley'
}}
Deˣ
  • 4,191
  • 15
  • 24
  • I have tried changing implementation files('libs/volley.jar') for implementation 'com.android.volley:volley:1.1.0' and the error continue happening – Liru Jun 19 '19 at 14:10
  • did you add `jcenter()` in your allprojects repositories ' – Deˣ Jun 19 '19 at 14:14
  • I have added to jcenter() and the error at least has change :D Now it shows Error: Program type already present: com.android.volley.AuthFailureError – Liru Jun 20 '19 at 09:08
  • I have updated the answer try that now. if it doesn't work. Go in libs folder and delete the volley.jar . You don't need that. Yes! you should make its backup anyway – Deˣ Jun 20 '19 at 09:28
  • add all*.exclude group: 'com.android.volley' save my day! All start working again! Thank you sooo much Derek – Liru Jun 20 '19 at 10:47