0

i am trying to implement PlaceAutoComplete powered by Google in my application. but i am unable to do this... i have implemented the required dependency in app-level build.gradle file and write code. but when i run the application it gives me following error. see this...

Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.android.volley:volley:1.1.1.
- https://dl.google.com/dl/android/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
- https://repo.maven.apache.org/maven2/com/android/volley/volley/1.1.1/volley-1.1.1.pom
Required by:
     project :app > com.google.android.libraries.places:places:2.4.0
Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

i surfed the internet but couldn't find anything in help about this thing.

This is Gradle Code...

plugins {
    id 'com.android.application'
    id 'com.google.gms.google-services'
}

android {
    compileSdkVersion 30
    buildToolsVersion "30.0.3"

    defaultConfig {
        applicationId "com.fyp.biketracker"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {

    implementation 'androidx.appcompat:appcompat:1.3.0'
    implementation 'com.google.android.material:material:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.fragment:fragment:1.3.6'
    implementation "com.google.android.libraries.places:places:2.4.0"
    implementation 'com.google.android.gms:play-services-maps:17.0.1'
    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'com.google.firebase:firebase-auth:19.2.0'
    implementation 'com.google.firebase:firebase-firestore:23.0.3'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    //for multidex
    implementation 'androidx.multidex:multidex:2.0.1'

    //Circle ImageView
    implementation 'de.hdodenhof:circleimageview:3.1.0'
}
Aqeel Mughal
  • 2,105
  • 2
  • 6
  • 14

1 Answers1

0

As you can see here:

https://mvnrepository.com/artifact/com.android.volley/volley/1.1.1

There are two repos which has this particular version of this lib, the spring repo and the AndroidUtils repo. So you need to add either of those to the "repositories" part of your gradle file as:

repositories {
        mavenCentral()
        maven {
            url "https://repo.spring.io/libs-release/"
        }
    }

Most likely this is because the Maven central only contains the newer versions:

https://mvnrepository.com/artifact/com.android.volley/volley

breakline
  • 5,776
  • 8
  • 45
  • 84