【发布时间】:2020-11-30 11:37:38
【问题描述】:
我正在尝试安装 Google Maps SDK 并决定使用当前的测试版。我已按照所有安装说明进行操作,但在重建项目时出现以下错误。
任务 ':app:checkDebugAarMetadata' 执行失败。
无法解析配置“:app:debugRuntimeClasspath”的所有文件。 找不到:places-maps-sdk-3.1.0-beta:。 要求: 项目:应用程序
安装下载的文件places-maps-sdk-3.1.0-beta.aar已经放在projectsapp\libs文件夹下。
[![enter image description here][1]][1]
附上我的项目级gradle build
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.grgapps.checkingin"
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
customDebugType {
debuggable true
}
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar','*.aar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.3.1'
implementation 'androidx.navigation:navigation-ui:2.3.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.gms:play-services-ads:19.5.0'
implementation 'com.google.firebase:firebase-ads:19.5.0'
implementation 'androidx.work:work-runtime:2.5.0-beta01'
implementation 'androidx.preference:preference:1.1.1'
//implementation 'com.google.android.gms:play-services-maps:17.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation "androidx.viewpager2:viewpager2:1.0.0"
implementation 'com.google.firebase:firebase-analytics:18.0.0'
implementation "com.google.firebase:firebase-messaging:21.0.0"
implementation 'com.google.android.libraries.maps:maps:3.1.0-beta'
// If you are using Places, add all of the dependencies below
implementation name:'places-maps-sdk-3.1.0-beta', ext:'aar'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.auto.value:auto-value-annotations:1.6.5'
implementation 'com.google.maps.android:android-maps-utils-v3:2.2.0'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation('com.mikepenz:materialdrawer:5.9.5@aar') {
transitive = true
exclude group: 'com.android.support'
}
// Room components
implementation "androidx.room:room-runtime:2.2.5"
annotationProcessor "androidx.room:room-compiler:2.2.5"
androidTestImplementation "androidx.room:room-testing:2.2.5"
// Lifecycle components
implementation "androidx.lifecycle:lifecycle-extensions:$rootProject.archLifecycleVersion"
annotationProcessor "androidx.lifecycle:lifecycle-compiler:$rootProject.archLifecycleVersion"
// UI
implementation "com.google.android.material:material:1.2.1"
// Testing
androidTestImplementation "androidx.arch.core:core-testing:$rootProject.coreTestingVersion"
}
以下是我的顶级构建 gradle 文件
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.1'
classpath 'com.google.gms:google-services:4.3.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext {
roomVersion = '2.2.5'
archLifecycleVersion = '2.2.0-rc03'
coreTestingVersion = '2.1.0'
materialVersion = '1.2.1'
}
【问题讨论】:
标签: java android google-maps