国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴庫并進(jìn)行本地配置 Gradle 依賴的解決方案 | 構(gòu)建 Maven 依賴下載路徑 )

這篇具有很好參考價(jià)值的文章主要介紹了【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴庫并進(jìn)行本地配置 Gradle 依賴的解決方案 | 構(gòu)建 Maven 依賴下載路徑 )。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。





一、報(bào)錯(cuò)信息



編譯 Android Studio 項(xiàng)目時(shí) , 報(bào)如下錯(cuò)誤 , 下載依賴庫失敗 ;

報(bào)錯(cuò)信息 :

Execution failed for task ':ijkplayer-exo:generateDebugRFile'.
> Could not resolve all files for configuration ':ijkplayer-exo:debugCompileClasspath'.
   > Could not resolve com.google.android.exoplayer:exoplayer:r1.5.11.
     Required by:
         project :ijkplayer-exo
      > Could not resolve com.google.android.exoplayer:exoplayer:r1.5.11.
         > Could not get resource 'https://raw.githubusercontent.com/Pgyer/analytics/master/com/google/android/exoplayer/exoplayer/r1.5.11/exoplayer-r1.5.11.pom'.
            > Could not HEAD 'https://raw.githubusercontent.com/Pgyer/analytics/master/com/google/android/exoplayer/exoplayer/r1.5.11/exoplayer-r1.5.11.pom'.
               > raw.githubusercontent.com

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴庫并進(jìn)行本地配置 Gradle 依賴的解決方案 | 構(gòu)建 Maven 依賴下載路徑 ),錯(cuò)誤記錄,android,maven,java,Maven倉庫,Google倉庫,構(gòu)建Maven依賴地址,依賴庫





二、解決方案




1、確定 Maven 倉庫地址


下面是 當(dāng)前 Android 項(xiàng)目的 Gradle 配置中的 Maven 倉庫 ;

allprojects {
    repositories {
        google()
        mavenCentral()
        jcenter() // Warning: this repository is going to shut down soon
        // ijkplayer 倉庫
        maven { url "https://repo.spring.io/plugins-release/" }
        maven { url "https://repository.mulesoft.org/nexus/content/repositories/public/" }
        maven { url "https://dl.bintray.com/bilibili/maven/" }
    }
}

其中使用 maven { url "https://repo.spring.io/plugins-release/" } 配置的 Maven 倉庫就是對(duì)應(yīng)的地址 ;

使用 google() 函數(shù)配置的 Maven 倉庫地址 是 https://maven.google.com/ , 可以通過 https://maven.google.com/web/index.html 地址搜索對(duì)應(yīng)的 依賴庫 ;

使用 mavenCentral() 函數(shù)配置的 Maven 倉庫地址是 https://repo1.maven.org/ ;

使用 jcenter() 函數(shù)配置的 Maven 倉庫地址是 http://jcenter.bintray.com , 目前已經(jīng)無法訪問 , 其依賴庫都遷移到了 Maven 中央倉庫 ;


2、構(gòu)建 Maven 依賴下載路徑


以 下載 org.springframework.boot:spring-boot-starter-web:2.5.0 為例 ,

  • 組織ID 是 org.springframework.boot , 其對(duì)應(yīng)的路徑是 org/springframework/boot/ ;
  • 構(gòu)件ID 是 spring-boot-starter-web ;
  • 版本號(hào) 是 2.5.0 ;

下載路徑公式是 : 倉庫地址/組織ID/構(gòu)件ID/版本號(hào)/構(gòu)件ID-版本號(hào).jar ;

倉庫地址是 https://repo1.maven.org/maven2/ 地址 ;

按照上面的公式拼接起來就是 https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web/2.5.0/spring-boot-starter-web-2.5.0.jar ;

將拼接的 https://repo1.maven.org/maven2/org/springframework/boot/spring-boot-starter-web/2.5.0/spring-boot-starter-web-2.5.0.jar 地址拷貝到瀏覽器中 , 就可以下載該 依賴庫 ;

下載完成后的文件如下 :

【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴庫并進(jìn)行本地配置 Gradle 依賴的解決方案 | 構(gòu)建 Maven 依賴下載路徑 ),錯(cuò)誤記錄,android,maven,java,Maven倉庫,Google倉庫,構(gòu)建Maven依賴地址,依賴庫

建議使用 wget 或者 curl 命令行工具下載 ;


3、檢查依賴庫是否存在


通過上述 Maven 倉庫依賴庫地址拼接 , 就可以知道 該 依賴庫是否在 Maven 倉庫中存在 , 如果存在就可以下載 , 如果不存在 , 則下載失敗 ;

到 Maven 倉庫中 對(duì)應(yīng)的地址 , 查找對(duì)應(yīng)的依賴庫 ;

如 : Maven 中央倉庫 , 使用 mavenCentral() 配置 ;

allprojects {
    repositories {
        mavenCentral()
    }
}

對(duì)應(yīng)的地址是 https://repo1.maven.org/maven2/ , 進(jìn)入該頁面后 , 顯示的內(nèi)容如下 :

【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴庫并進(jìn)行本地配置 Gradle 依賴的解決方案 | 構(gòu)建 Maven 依賴下載路徑 ),錯(cuò)誤記錄,android,maven,java,Maven倉庫,Google倉庫,構(gòu)建Maven依賴地址,依賴庫
按照路徑查找 com.google.android.exoplayer:exoplayer:r1.5.11 依賴庫 ;

找到 https://repo1.maven.org/maven2/com/google/android/ 層級(jí) , 就沒有對(duì)應(yīng)的依賴庫了 , 說明在 Maven 中央倉庫 https://repo1.maven.org/maven2/ 中沒有 com.google.android.exoplayer:exoplayer 依賴庫 ;

【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴庫并進(jìn)行本地配置 Gradle 依賴的解決方案 | 構(gòu)建 Maven 依賴下載路徑 ),錯(cuò)誤記錄,android,maven,java,Maven倉庫,Google倉庫,構(gòu)建Maven依賴地址,依賴庫


4、在 Gradle 中配置本地依賴


下載到本地后 , 將 下載的 依賴庫拷貝到本地路徑中 , 然后將相對(duì)路徑配置到 dependencies / implementation 依賴中 ;文章來源地址http://www.zghlxwxcb.cn/news/detail-852005.html

dependencies {  
    implementation files('path/to/your/downloaded/dependency.jar')  
}

到了這里,關(guān)于【錯(cuò)誤記錄】Android 編譯報(bào)錯(cuò) ( Could not resolve xxx | 手動(dòng)下載依賴庫并進(jìn)行本地配置 Gradle 依賴的解決方案 | 構(gòu)建 Maven 依賴下載路徑 )的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • springboot報(bào)錯(cuò):Could not resolve placeholder ‘xxx‘ in value “${XXXX}

    在springboot項(xiàng)目請啟動(dòng)時(shí),我們使用@Value注解從配置文件取出屬性值的時(shí)候, 有可能出現(xiàn)無法解析的狀況。 此時(shí)我們需要在啟動(dòng)類中加上占位符配置即可

    2024年02月11日
    瀏覽(36)
  • SpringCloud讀取Nacos配置中心報(bào)錯(cuò):Could not resolve placeholder ‘xxx’ in value ‘${xxx}

    SpringCloud讀取Nacos配置中心報(bào)錯(cuò):Could not resolve placeholder ‘xxx’ in value ‘${xxx}

    hello,我是灰小猿,一個(gè)超會(huì)寫bug的程序員! 近期在寫一個(gè)spring cloud Alibaba讀取Nacos配置中心遠(yuǎn)程配置文件的內(nèi)容時(shí),出現(xiàn)了幾個(gè)比較坑的bug,在此記錄一下,幫大家避避坑。 我的使用場景: SpringBoot版本為2.6.0 Spring Cloud版本為2021.0.1 Spring Cloud Alibaba版本為2021.0.1.0 如果你的C

    2024年02月05日
    瀏覽(27)
  • 解決Build failed:Could not resolve com.android.tools.build:gradle:XXX

    解決Build failed:Could not resolve com.android.tools.build:gradle:XXX

    先創(chuàng)建的項(xiàng)目在build時(shí)出現(xiàn)下面的報(bào)錯(cuò): 原因:此為Android Studio默認(rèn)的JDK版本與項(xiàng)目配置的Gradle所需的JDK不一致導(dǎo)致沖突所致。要求選擇同一版本的JDK。 解決方案:點(diǎn)擊File --Project Structure -SDK Location-JDK location gradle Settings,將Gradle user home和項(xiàng)目的Gradle JDK改為一樣的版本目錄。

    2024年02月11日
    瀏覽(22)
  • Maven編譯報(bào)錯(cuò):Could not resolve dependencies for project

    編譯項(xiàng)目時(shí) 出現(xiàn)報(bào)錯(cuò): Failed to execute goal on project xxx-mybatis: Could not resolve dependencies for project com.xxx:xxx-mybatis:jar:0.0.1-SNAPSHOT: Could not transfer artifact org.mybatis:mybatis:jar:3.4.5 from/to central ( https://repo.maven.apache.org/maven2): GET request of: org/mybatis/mybatis/3.4.5/mybatis-3.4.5.jar from central failed: Pr

    2024年02月03日
    瀏覽(128)
  • IDEA項(xiàng)目啟動(dòng)報(bào)錯(cuò):Failed to execute goal on project xxx: Could not resolve dependencies for project

    IDEA項(xiàng)目啟動(dòng)報(bào)錯(cuò):Failed to execute goal on project xxx: Could not resolve dependencies for project

    [ERROR] Failed to execute goal on project xxx: Could not resolve dependencies for project Failed to collect dependencies at xxx .xxx-service:jar:dev: Failed to read artifact descriptor for xxxx/maven-snapshots/ during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of nexus-snaps

    2024年02月03日
    瀏覽(247)
  • Android Studio報(bào)錯(cuò):Could not resolve com.android.tools.build:gradle:8.0.0

    Android Studio報(bào)錯(cuò):Could not resolve com.android.tools.build:gradle:8.0.0

    Android Studio 新建項(xiàng)目會(huì)報(bào)以下錯(cuò)誤: 完整版報(bào)錯(cuò)信息如下: 原因:此為Android Studio默認(rèn)的JDK版本與項(xiàng)目配置的Gradle所需的JDK不一致導(dǎo)致沖突所致。要求選擇同一版本的JDK,可以選擇Android Studio自帶的jdk17。 解決方案:點(diǎn)擊File --Project Structure -SDK Location-JDK location gradle Settings,將

    2024年02月11日
    瀏覽(21)
  • Android報(bào)錯(cuò)之Could not resolve all files for configuration ‘:app:debugRuntimeClasspath‘.
  • ChatGPT問答:Android項(xiàng)目報(bào)錯(cuò)Could not resolve com.android.tools.build:gradle:7.4.2.

    ChatGPT問答:Android項(xiàng)目報(bào)錯(cuò)Could not resolve com.android.tools.build:gradle:7.4.2.

    這個(gè)錯(cuò)誤提示表明你在構(gòu)建你的Android項(xiàng)目時(shí),Gradle無法解析com.android.tools.build:gradle:7.4.2這個(gè)版本的Gradle插件??赡苁且?yàn)檫@個(gè)版本的Gradle插件不存在,或者你的網(wǎng)絡(luò)連接有問題,導(dǎo)致Gradle無法從遠(yuǎn)程倉庫下載這個(gè)插件。 為了解決這個(gè)問題,你可以嘗試以下幾個(gè)方法: 檢查網(wǎng)

    2024年02月08日
    瀏覽(111)
  • spring:Could not resolve placeholder ‘XXX‘ in value “${XXX}“

    1、背景 使用 @Value 注解從配置文件中讀取值時(shí)出現(xiàn)\\\"Could not resolve placeholder\\\"很有可能是使用了多個(gè)PropertyPlaceholderConfigurer或者多個(gè)context:property-placeholder的原因。 2、原因 因?yàn)閟pring通過反射機(jī)制加載外部資源 context:property-placeholder location=\\\"classpath:XXX.properties\\\"/ 在探測到Spring容器中

    2024年02月11日
    瀏覽(30)
  • Could not resolve placeholder “xxx“ in value “${}“

    Could not resolve placeholder “xxx“ in value “${}“

    在網(wǎng)上看了很多方法,都沒有用。 首先我確定我的yml配置文件里面配置沒有錯(cuò): 然后地址引用的地方也加了@Value,類上也加了@Service注解,引用的格式也沒有錯(cuò) ? 其次,我也試過了maven install,package,再三檢查了target文件里面有配置文件, 發(fā)現(xiàn)都沒有錯(cuò) 但是就是報(bào)錯(cuò),經(jīng)過

    2024年02月08日
    瀏覽(19)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包