4

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'

Ruli
  • 2,592
  • 12
  • 30
  • 40
Morgs
  • 65
  • 7

3 Answers3

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()
    }
}
Ruli
  • 2,592
  • 12
  • 30
  • 40
myturmudi
  • 201
  • 3
  • 8
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.

Yuhn1m
  • 11
  • 1
  • @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." – Scratte Sep 17 '21 at 12:47
0

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' }
    }
}

flowey
  • 1