5

I have created the account and key needed from Mapbox. I have listed the repositories in different order with no luck. Whn building, the following error appears:

Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

Could not find com.mapbox.mapboxsdk:mapbox-android-accounts:0.7.0. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom - https://repo.maven.apache.org/maven2/com/mapbox/mapboxsdk/mapbox-android-accounts/0.7.0/mapbox-android-accounts-0.7.0.pom Required by: project :app > com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1

Here's my build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    ext.kotlin_version = "1.5.20"
    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 
                password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
            }
        }


    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.2.1"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()

    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

I've added the following to my module level build.gradle implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:9.2.1'

2
  • Did you find a solution to this? Commented Aug 23, 2021 at 8:19
  • No. I decided to go with a different mapping solution. Commented Aug 24, 2021 at 13:08

3 Answers 3

5

I have only added jcenter() and it works. However, jcenter() is deprecated.

buildscript {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.1'
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
}
Sign up to request clarification or add additional context in comments.

2 Comments

Same issue solved like that. It's really strange... Any alternatives for Mapbox (does not include Google Maps please haha)
Solved with this! just added it to all allProjects. Android is a joke.
1

It seem like they remove mapbox-android-accounts repository. Check this: https://mvnrepository.com/artifact/com.mapbox.mapboxsdk/mapbox-android-accounts/0.8.0

Github page is empty.

1 Comment

@Nol4635 How is this not answering the Question? The Question is asking why it's not working when I'm linking to and using this library, and this is saying "It's not working because the repository has been removed."
-1

Works for me after jcenter() added.

I added jcenter() to buildscript -> repositories and allprojects -> repositories:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext {
        buildToolsVersion = "30.0.2"
        minSdkVersion = 21
        compileSdkVersion = 30
        targetSdkVersion = 30
        ndkVersion = "21.4.7075529"
    }
    repositories {
        google()
        jcenter()
        mavenCentral()
    }
    dependencies {
        classpath("com.android.tools.build:gradle:4.2.2")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
        mavenCentral()
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }
       maven {
            url 'https://api.mapbox.com/downloads/v2/releases/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                username "mapbox"
                password "YOUR_TOKEN"
            }
        }

        google()
        maven { url 'https://www.jitpack.io' }
    }
}

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.