mapbox / mapbox-vision-android

Other
50 stars 43 forks source link

Unable to resolve dependency for ':Examples@debugUnitTest/compileClasspath' #254

Closed KayHung closed 4 years ago

KayHung commented 4 years ago

I build mapbox-vision-android-dev example, but build failed and show below message Unable to resolve dependency for ':Examples@debugUnitTest/compileClasspath': Could not resolve com.mapbox.vision:mapbox-android-vision-ar:0.13.0.

Could not GET 'https://api.mapbox.com/downloads/v1/vision/android/maven/com/mapbox/vision/mapbox-android-vision/0.13.0/mapbox-android-vision-0.13.0.pom'. Received status code 403 from server: Forbidden

build gradle(Module)

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

apply from: '../gradle/generate-token.gradle'

apply from: "../gradle/utils.gradle"
apply from: "../gradle/versions.gradle"
apply from: "../gradle/ktlint.gradle"

android {
    compileSdkVersion compile_sdk_version

    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }

    defaultConfig {
        applicationId "com.mapbox.vision.examples"
        minSdkVersion min_sdk_version
        targetSdkVersion target_sdk_version
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    sourceSets {
        main {
            java.srcDirs += 'src/main/java'
            java.srcDirs += 'src/main/kotlin'
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.aar'])
    implementation("com.serenegiant:common:$uvccamera_common") {
        exclude module: 'support-v4'
    }

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

    implementation "androidx.appcompat:appcompat:$android_x_appcompat"

    implementation "com.mapbox.mapboxsdk:mapbox-android-sdk:$mapbox_sdk"
    implementation "com.mapbox.mapboxsdk:mapbox-android-navigation:$mapbox_navigation"
    implementation "com.mapbox.mapboxsdk:mapbox-android-navigation-ui:$mapbox_navigation"
    implementation "com.mapbox.mapboxsdk:mapbox-android-core:$mapbox_core"

    ktlint "com.pinterest:ktlint:$ktlint_version"

    implementation "com.mapbox.vision:mapbox-android-vision:$vision"
    implementation "com.mapbox.vision:mapbox-android-vision-ar:$vision"
    implementation "com.mapbox.vision:mapbox-android-vision-safety:$vision"
}

build gradle(Project)

buildscript {
    if (file("${rootDir}/gradle/versions.gradle").exists()) {
        apply from: "${rootDir}/gradle/versions.gradle"
    }

    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:$gradle_plugin"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        google()
        jcenter()

        maven { url "https://mapbox.bintray.com/mapbox" }

        maven{
            url 'https://api.mapbox.com/downloads/v1/vision/android/maven'
            authentication {
                basic(BasicAuthentication)
            }
            credentials {
                username project.properties['mapboxMavenUser'] ?: ""
                password project.properties['mapboxMavenToken'] ?: ""
            }
        }

        maven { url 'http://raw.github.com/saki4510t/libcommon/master/repository/' }
    }
}
yunikkk commented 4 years ago

Hey,

have you added mapboxMavenUser/mapboxMavenToken as described at https://vision.mapbox.com/install/ in the Android section ?

KayHung commented 4 years ago

@yunikkk Yes, I have added mapboxMavenUser/mapboxMavenToken

KayHung commented 4 years ago

@yunikkk The problem I have solved. Thanks!