Mapbox-gl-native: problem add dependency project Androidx

Created on 7 Jan 2019  路  5Comments  路  Source: mapbox/mapbox-gl-native

i'm use :

  • java 1.8
  • gradle 3.2.1
  • androidx

add dependency : 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'

and show error :

Failed to resolve: fragment
Open File


Failed to resolve: core
Open File

Does it not support Android or is the problem from somewhere else?
thanks

Android needs information

All 5 comments

@FarshidRoohi
are you enabling jetifier so your build process converts support libs to androidx?
More information in https://developer.android.com/jetpack/androidx/.

@tobrun
I'm familiar with Androidx
The problem is that I only add this library

i'm test another project migrate androidx and add map-box sdk and worked
but not add dependency my project
asked question this

@FarshidRoohi

I did a quick test by creating an new Android Studio project with an empty activity template.
Afterwards migrated to AndroidX using the Android Studio menu option and added Maps SDK gradle line with the java 8 configuration.

I'm able to compile this without an build error, this is my build.gradle:

apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

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

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

I've added the following dependencies and my problem has been resolved 馃憤

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
kapt 'androidx.databinding:databinding-compiler:3.3.0'

I do not know if this was a problem, or something that I did not understand was resolved.

@FarshidRoohi that config definitely makes sense. Thank you for reporting this back to us!

Was this page helpful?
0 / 5 - 0 ratings