Arcgis runtime for Android 問題解決:Could not resolve,Received status code 403 from server: Forbidden

最近新建項(xiàng)目引用arcgis runtime for Android 時(shí),按照官網(wǎng)步驟一步步來,結(jié)果發(fā)現(xiàn)引入不了,項(xiàng)目下的build.gradle中也添加了倉庫

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

構(gòu)建項(xiàng)目報(bào)錯(cuò):

Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.esri.arcgisruntime:arcgis-android:100.8.0.
Show Details
Affected Modules: app

運(yùn)行時(shí)報(bào)錯(cuò):

Could not HEAD 'https://esri.bintray.com/arcgis/com/esri/arcgisruntime/arcgis-android/100.8.0/arcgis-android-100.8.0.pom'. Received status code 403 from server: Forbidden
Disable Gradle 'offline mode' and sync project

提示網(wǎng)站拒絕了請求,

解決方案:

將項(xiàng)目下的build.gradle

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

替換為:

allprojects {
    repositories {
    ...
    maven { url 'https://esri.jfrog.io/artifactory/arcgis' }
    ...
    }
}

之后重新構(gòu)建,就可以引入成功了。

擴(kuò)展:

在解決這個(gè)問題的時(shí)候,順便把其他倉庫都替換成了阿里云鏡像倉庫,構(gòu)建時(shí)間大大減少。

repositories {
        maven { url 'https://maven.aliyun.com/repository/public' }//jcenter
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }//gradle-plugin
        maven { url 'https://maven.aliyun.com/repository/central' }//central
        maven { url 'https://maven.aliyun.com/repository/google' }//google
        google()
        jcenter()
    }
···
allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/public' }//jcenter
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }//gradle-plugin
        maven { url 'https://maven.aliyun.com/repository/central' }//central
        maven { url 'https://maven.aliyun.com/repository/google' }//google
        maven { url 'https://esri.jfrog.io/artifactory/arcgis' }
        maven { url 'https://jitpack.io' }
        google()
        jcenter()
        flatDir{
            dirs 'libs'//A依賴B,B依賴C,要想A能訪問C的libs,就得添加這個(gè)
        }
    }
}
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容