2

problem add mapBoxSDK android

gradle class path this :

 classpath 'com.android.tools.build:gradle:3.2.1'

and libs :

  implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
  implementation 'com.google.android.material:material:1.1.0-alpha02'

  implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'

error this :

Failed to resolve: fragment
Open File


Failed to resolve: core
Open File

UPDATE

gradle app file :

use androidx & java 1.8 & gradle 2.3.1

I guess I do not support Androidx? Do you think this is a problem? apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' apply plugin: 'io.fabric'

android {
    compileSdkVersion 28
    defaultConfig {
        applicationId "xxxx"
        minSdkVersion 17
        targetSdkVersion 28
       ....
    }
   ...
    dataBinding {
        enabled = true
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    def lifecycle_version = "2.1.0-alpha01"
    def room_version = "2.0.0-rc01"
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha01'
    implementation 'com.google.android.material:material:1.1.0-alpha02'
    implementation 'androidx.constraintlayout:constraintlayout:2.0.0-alpha3'

    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"
    // lifecycle
    implementation "androidx.lifecycle:lifecycle-extensions:$lifecycle_version"
    kapt "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
    implementation 'com.google.firebase:firebase-core:16.0.6'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.9.8'
    implementation 'org.osmdroid:osmdroid-android:6.0.3'

    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-navigation:0.26.0'


}
3
  • Can you please show your complete gradle files. Commented Jan 7, 2019 at 12:37
  • mapbox.com/android-docs/navigation/overview follow this link Commented Jan 7, 2019 at 12:39
  • @suresh-madaparthi thanks , unfortunately, it does not help Commented Jan 7, 2019 at 12:52

3 Answers 3

0

It looks like you're adding your dependencies to the project level gradle file. Class path addresses should go in the project level buid.gradle file whilst library dependencies should go into the app level build.gradle files.

In your app level build.gradle you should add:

dependencies {
...
   implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
   implementation 'com.google.android.material:material:1.1.0-alpha02'
   implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:6.8.1'
}

And in your project level you should add:

dependencies {
...
  classpath 'com.android.tools.build:gradle:3.2.1'
 }
Sign up to request clarification or add additional context in comments.

Comments

0

You need to add in your Project->build.gradle file

allprojects {
    repositories {
        ...
        maven { url 'https://mapbox.bintray.com/mapbox' }
    }
}

2 Comments

Unfortunately, it does not help
Maybe its cause by other dependencies. try commenting mapbox sdk
0

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

i'm remove :

 implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

and added this :

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.