gpt4 book ai didi

java - Android Studio 中的错误 play-services-maps :17. 0.1

转载 作者:行者123 更新时间:2023-12-05 00:11:47 25 4
gpt4 key购买 nike

以下错误发生在我身上:

ERROR: Manifest merger failed with multiple errors, see logs (Gradle sync issues -> Manifest merger failed with multiples erros, see logs)

AndroidManifest.xml 文件指出错误是:

  • 合并错误:错误:AndroidManifest.xml:33:9-64 play-services-maps:17.0.1 list 中的元素包上缺少“package”键属性,第 32 行错误:
  • 验证失败,正在退出 play-services-maps:17.0.1 list
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.gms.maps" >

<uses-sdk android:minSdkVersion="14" />

<!-- Include required permissions for Google Maps API to run. -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />

<queries>

<!-- Needs to be explicitly declared on Android R+ -->
<package android:name="com.google.android.apps.maps" />
</queries>

<application>

<!-- Needs to be explicitly declared on P+ -->
<uses-library
android:name="org.apache.http.legacy"
android:required="false" />
</application>

</manifest>
  • build.gradle(项目:app)
    apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example.testmaps"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}

最佳答案

如果您将 com.google.android.gms:play-services-maps:17.0.1 替换为 com.google.android.gms:play-services-maps:17.0。 0,你的问题就解决了。基本上你必须使用 play-services-maps

17.0.0

关于java - Android Studio 中的错误 play-services-maps :17. 0.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67970565/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com