在我将以下依赖项添加到gradle和sync之后:
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.miniprojetandroid"
minSdkVersion 14
targetSdkVersion 30
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.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
//ROOM
implementation 'androidx.room:room-runtime:2.2.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
annotationProcessor 'androidx.room:room-compiler:2.2.0'
repositories {
mavenCentral()
}
implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:4.3.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-places-v7:0.7.0'
implementation ('com.mapbox.mapboxsdk:mapbox-android-geocoder:1.0.0@aar'){
transitive=true
}
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-annotation-v7:0.4.0'
implementation 'com.mapbox.mapboxsdk:mapbox-android-plugin-markerview-v7:0.2.0'
//Material
implementation 'com.google.android.material:material:1.0.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.google.code.gson:gson:2.6.1'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.1'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.bumptech.glide:glide:3.7.0'
//Glide
implementation 'com.github.bumptech.glide:glide:4.10.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
启动应用程序时,我获得了错误消息:
Manifest merger failed : uses-sdk:minSdkVersion 14 cannot be smaller than version 15 declared in library [com.mapbox.mapboxsdk:mapbox-android-geocoder:1.0.0] C:\Users\Fares\.gradle\caches\transforms-2\files-2.1\b8f13035bf89de10e6748e7ed482a3bc\jetified-mapbox-android-geocoder-1.0.0\AndroidManifest.xml as the library might be using APIs not available in 14
Suggestion: use a compatible library with a minSdk of at most 14,
or increase this project's minSdk version to at least 15,
or use tools:overrideLibrary="com.mapbox.geocoder" to force usage (may lead to runtime failures)
我应该如何处理此类错误?
要解决此错误,您必须将最低SDK版本从14增加到15。
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.miniprojetandroid"
minSdkVersion 15
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
但是,此示例使用的是Mapbox SDK的过时版本。我建议您遵循以下文档来安装Mapbox SDK:
https://docs.mapbox.com/android/maps/guides/install/
然后,您可以选择以下示例:
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句