Closed Kashif-E closed 3 years ago
@Kashif-E Can you check if you are using correct gradle configurations.
follow the guide here : https://docs.mapbox.com/android/beta/maps/guides/install/#add-the-dependency
@ank27 I have updated my build.gradle files in the top comment I think. they. are correctly. configured
@Kashif-E , from the app's build.gradle
file, you are using multiple versions of maps sdk. we recommend using latest version of maps sdk v10.0.0. you can remove v9.+
, 10.0.0-rc.8
and use the latest version for the dependencies.
Use something like this :
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Mapbox dependency
implementation 'com.mapbox.maps:android:10.0.0'
implementation "com.gorisse.thomas.sceneform:sceneform:1.20.1"
implementation("com.google.android.gms:play-services-location:18.0.0")
}
If you are migrating from v9 to v10, use the migration guide https://docs.mapbox.com/android/beta/maps/guides/migrate-to-v10/[](https://docs.mapbox.com/android/beta/maps/guides/migrate-to-v10/)
@ank27 thanks for this but it does not resolve the dependecies issue
hmm, then probably you are not defining the repositories config for all projects. use something like this in your root build.gradle
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
}
}
allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = 'mapbox'
// Use the secret token you stored in gradle.properties as the password
password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.property("SDK_REGISTRY_TOKEN") as String
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
@ank27 thanks it was the. issue indeed
I am trying to build my project but none of these dependencies are getting resolved
implementation 'com.mapbox.maps:android:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-annotation:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-locationcomponent:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-gestures:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-compass:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-animation:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-scalebar:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-logo:10.0.0-rc.8' implementation 'com.mapbox.plugin:maps-attribution:10.0.0-rc.8'
errors i am getting
Failed to resolve: com.mapbox.plugin:maps-gestures:10.0.0-rc.8 Failed to resolve: com.mapbox.plugin:maps-compass:10.0.0-rc.8 Failed to resolve: com.mapbox.plugin:maps-animation:10.0.0-rc.8 Failed to resolve: com.mapbox.plugin:maps-scalebar:10.0.0-rc.8 Failed to resolve: com.mapbox.navigation:android:2.0.0-rc.7 Failed to resolve: com.mapbox.plugin:maps-annotation:10.0.0-rc.8 Failed to resolve: com.mapbox.plugin:maps-logo:10.0.0-rc.8 Failed to resolve: com.mapbox.plugin:maps-attribution:10.0.0-rc.8 Failed to resolve: com.mapbox.plugin:maps-locationcomponent:10.0.0-rc.8 Failed to resolve: com.mapbox.navigator:mapbox-navigation-native:6.2.1 Failed to resolve: com.mapbox.maps:android:10.0.0-rc.8
this is my build.gradle (app)
plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt'
}
android { compileSdk 31
}
dependencies {
}
this Is my project level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() mavenCentral() maven { url 'https://api.mapbox.com/downloads/v2/releases/maven' authentication { basic(BasicAuthentication) } credentials { // Do not change the username below. // This should always be
mapbox
(not your username). username = 'mapbox' // Use the secret token you stored in gradle.properties as the password password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] } } }}
task clean(type: Delete) { delete rootProject.buildDir }