Mapbox安装依赖项失败

票价本·斯拉玛

我按照本教程安装了MapBox https://medium.com/fabcoding/mapbox-tutorial-for-android-map-geolocation-markers-bd9255947d99https://medium.com/fabium/mapcoding-mapbox-tutorial-for-android-map -geolocation-markers-bd9255947d99

在我将以下依赖项添加到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/

然后,您可以选择以下示例:

https://docs.mapbox.com/android/maps/examples/

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

安装Go依赖项失败

dist升级后,安装的依赖项失败

安装RPM时对libstdc ++(GLIBCXX _...)的依赖项失败

Pip 正在 /tmp/ 中安装依赖项并且构建失败

Docker composer命令在安装composer依赖项期间失败

依赖项失败:从rpm安装openssl时出错

尝试安装依赖项时,VS Code总是失败

npm安装因多层本地依赖项而失败

安装 Salesforce IDE 时 Eclipse 依赖项失败

如何在android studio中正确安装mapbox?安装依赖项后找不到活动?

如何安装依赖项

未安装依赖项

无法安装依赖项

docker 安装依赖失败

pip:安装依赖项的依赖项

由于依赖项和配置问题,内核安装失败会导致apt和dpkg失败

无法游民安装插件:尽管已安装gem依赖项仍失败

SQL Server 2014安装失败:该功能的依赖项发生错误,导致该功能的安装过程失败

NPM注册表安装在非注册表依赖项上失败

错误:此模板所需的iOS项目的CocoaPods依赖项安装失败。

依赖项安装失败!laravel应用程序部署到heroku时出错

堆栈安装ghc-mod失败,并且在OSX 10.13.4上存在依赖项冲突

以用户 ubuntu 身份运行的脚本/安装依赖项失败,退出代码为 1

VsGraphics帮助程序依赖项导致Visual Studio 2013安装失败(不是加密消息)

为什么在创建 React Native 应用程序时安装的 cocoapods 依赖项失败?

CodeLite安装缺少依赖项

安装curl的依赖项错误

Composer无法安装依赖项

如何安装matplotlib依赖项?