Required by:project:app > com.google.android.libraries.places:places:2.4.0

tjjdgumg  于 2024-01-04  发布在  Android
关注(0)|答案(2)|浏览(174)

我试图在我的应用程序中实现Google提供的PlaceAutoComplete。但我无法做到这一点.我已经实现了应用程序级构建所需的依赖关系。gradle文件和编写代码。但当我运行应用程序时,它给了我以下错误。请参阅此.

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

字符串
我上网查了一下,也没找到这方面的帮助。
这是Gradle代码。

  1. plugins {
  2. id 'com.android.application'
  3. id 'com.google.gms.google-services'
  4. }
  5. android {
  6. compileSdkVersion 30
  7. buildToolsVersion "30.0.3"
  8. defaultConfig {
  9. applicationId "com.fyp.biketracker"
  10. minSdkVersion 19
  11. targetSdkVersion 30
  12. versionCode 1
  13. versionName "1.0"
  14. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  15. multiDexEnabled true
  16. }
  17. buildTypes {
  18. release {
  19. minifyEnabled false
  20. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  21. }
  22. }
  23. compileOptions {
  24. sourceCompatibility JavaVersion.VERSION_1_8
  25. targetCompatibility JavaVersion.VERSION_1_8
  26. }
  27. }
  28. dependencies {
  29. implementation 'androidx.appcompat:appcompat:1.3.0'
  30. implementation 'com.google.android.material:material:1.4.0'
  31. implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
  32. implementation 'androidx.legacy:legacy-support-v4:1.0.0'
  33. implementation 'androidx.fragment:fragment:1.3.6'
  34. implementation "com.google.android.libraries.places:places:2.4.0"
  35. implementation 'com.google.android.gms:play-services-maps:17.0.1'
  36. implementation 'com.google.android.gms:play-services-location:18.0.0'
  37. implementation 'com.google.firebase:firebase-auth:19.2.0'
  38. implementation 'com.google.firebase:firebase-firestore:23.0.3'
  39. testImplementation 'junit:junit:4.13.2'
  40. androidTestImplementation 'androidx.test.ext:junit:1.1.3'
  41. androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
  42. //for multidex
  43. implementation 'androidx.multidex:multidex:2.0.1'
  44. //Circle ImageView
  45. implementation 'de.hdodenhof:circleimageview:3.1.0'
  46. }

t5zmwmid

t5zmwmid1#

如图所示:
https://mvnrepository.com/artifact/com.android.volley/volley/1.1.1
有两个repo拥有这个特定版本的lib,spring repo和AndroidUtils repo。所以你需要将其中任何一个添加到gradle文件的“repositories”部分:

  1. repositories {
  2. mavenCentral()
  3. maven {
  4. url "https://repo.spring.io/libs-release/"
  5. }
  6. }

字符串
这很可能是因为Maven中心只包含较新的版本:
https://mvnrepository.com/artifact/com.android.volley/volley

tkqqtvp1

tkqqtvp12#

在build.gradle(app)中添加volley库

  1. dependencies {
  2. implementation ("com.android.volley:volley:1.2.1")
  3. }

字符串
然后纠正你的错误。

相关问题