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

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

這篇具有很好參考價(jià)值的文章主要介紹了Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

A problem occurred configuring root project 'MyApplication2'.

> Could not resolve all files for configuration ':classpath'.

?? > Could not resolve com.android.tools.build:gradle:7.4.2.

?? ? Required by:

?? ? ? ? project : > com.android.application:com.android.application.gradle.plugin:7.4.2

?? ? ? ? project : > com.android.library:com.android.library.gradle.plugin:7.4.2

? ? ? > No matching variant of com.android.tools.build:gradle:7.4.2 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but:

? ? ? ? ? - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.2 declares a library, packaged as a jar, and its dependencies declared externally:

? ? ? ? ? ? ? - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8

? ? ? ? ? ? ? - Other compatible attribute:

? ? ? ? ? ? ? ? ? - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')

? ? ? ? ? - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:

? ? ? ? ? ? ? - Incompatible because this component declares documentation and the consumer needed a library

? ? ? ? ? ? ? - Other compatible attributes:

? ? ? ? ? ? ? ? ? - Doesn't say anything about its target Java version (required compatibility with Java 8)

? ? ? ? ? ? ? ? ? - Doesn't say anything about its elements (required them packaged as a jar)

? ? ? ? ? ? ? ? ? - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')

? ? ? ? ? - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:

? ? ? ? ? ? ? - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8

? ? ? ? ? ? ? - Other compatible attribute:

? ? ? ? ? ? ? ? ? - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')

? ? ? ? ? - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.2 declares a runtime of a component, and its dependencies declared externally:

? ? ? ? ? ? ? - Incompatible because this component declares documentation and the consumer needed a library

? ? ? ? ? ? ? - Other compatible attributes:

? ? ? ? ? ? ? ? ? - Doesn't say anything about its target Java version (required compatibility with Java 8)

? ? ? ? ? ? ? ? ? - Doesn't say anything about its elements (required them packaged as a jar)

? ? ? ? ? ? ? ? ? - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')

? ? ? 昨天用老版本的Android Studio 新建了一個(gè)Kotlin項(xiàng)目,. 之類的提示沒有,應(yīng)該是環(huán)境問題,就升級(jí)了Android Studio到最新的電鰻版本,新建kotlin項(xiàng)目就報(bào)上述錯(cuò)誤。

? ? ? 搜索了一圈,原來是gradle插件7.4.2版本比較新,需要Java11,以前配置的是Java8,修改下配置就可以了,以mac電腦為例,操作如下:

1、左上角 File ------- Project Structure, 如圖:

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

?2、SDK Location -----------? Gradle Settings ,如圖:

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

?3、Gradle JDK, 選擇11的,點(diǎn)擊OK , 如圖:

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

?4、Settings.gradle文件里,配置一些倉(cāng)庫(kù)地址,如圖:

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題?代碼如下:

pluginManagement {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/releases' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
        maven { url "https://www.jitpack.io" }
        google()
        mavenCentral()
        gradlePluginPortal()
        jcenter()

    }
}
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        maven { url 'https://maven.aliyun.com/repository/releases' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
        maven { url "https://www.jitpack.io" }
        google()
        mavenCentral()
        jcenter()
    }
}
rootProject.name = "MyApplication2"
include ':app'

?5、點(diǎn)擊同步按鈕,下載相應(yīng)的庫(kù),如圖:

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

6、 等待下載完畢,可能需要幾分鐘到幾十分鐘,只要下載進(jìn)度是對(duì)的,就OK,如圖:

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

7、. 已經(jīng)可以正常提示語(yǔ)法了

Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題

好了,又可以愉快的玩耍了。文章來源地址http://www.zghlxwxcb.cn/news/detail-428989.html

到了這里,關(guān)于Android Studio 解決Could not resolve com.android.tools.build:gradle:7.4.2問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

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

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

相關(guān)文章

  • Could not resolve com.android.tools.build:gradle:7.4.2.

    Could not resolve com.android.tools.build:gradle:7.4.2.

    Android Studio 新建工程時(shí)報(bào)錯(cuò) Could not resolve com.android.tools.build:gradle:7.4.2. 原因: Android Studio默認(rèn)的JDK版本與項(xiàng)目配置的Gradle所需的JDK不一致導(dǎo)致沖突所致 解決方法:進(jìn)入Preferences-Build,Execution,Deployment-Build Tools-Gradle中,將Gradle user home和項(xiàng)目的Gradle JDK改為一樣的版本目錄

    2024年02月11日
    瀏覽(22)
  • Android新項(xiàng)目出錯(cuò)Could not resolve com.android.tools.build:aapt2***

    本人遇到的解決辦法: 1、修改項(xiàng)目根目錄下的build.gradle文件里下面的版本號(hào) 將以上兩個(gè)的版本號(hào)對(duì)應(yīng)改好。具體兩個(gè)版本號(hào)的對(duì)應(yīng)關(guān)系,請(qǐng)參看下面的這個(gè)博客地址 Android Gradle插件對(duì)應(yīng)的Gradle所需版本_帥次的博客-CSDN博客_gradle版本號(hào)對(duì)應(yīng)的版本 ?

    2024年02月15日
    瀏覽(100)
  • 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)程倉(cāng)庫(kù)下載這個(gè)插件。 為了解決這個(gè)問題,你可以嘗試以下幾個(gè)方法: 檢查網(wǎng)

    2024年02月08日
    瀏覽(111)
  • android gradle 8.0.1構(gòu)建失?。–ould not resolve com.android.tools.build:gradle:8.0.1.)

    背景 :初次創(chuàng)建項(xiàng)目失敗。 分析: 很可能是java 8的問題,(ps:一般初構(gòu)建項(xiàng)目,在更新as之后很容易出現(xiàn)這個(gè)問題),通常改為Java 11來處理。 打開Android Studio并導(dǎo)航到FileProject Structure。 SDK location面板中點(diǎn)擊Gradle Settings 選擇Java11或者內(nèi)置的高版本Java JDK(embedded java sdk) 再次

    2024年02月16日
    瀏覽(27)
  • Cordova 12編譯報(bào)錯(cuò)Could not resolve com.android.tools.build:gradle:7.4.2.

    一、在使用Cordova12 創(chuàng)建項(xiàng)目后編譯時(shí)候報(bào)錯(cuò) A problem occurred configuring root project \\\'HelloCordova\\\'. Could not resolve all files for configuration \\\':classpath\\\'. ? ? Could not resolve com.android.tools.build:gradle:7.4.2.

    2024年02月10日
    瀏覽(25)
  • 【坑】導(dǎo)入項(xiàng)目報(bào)錯(cuò)Could not find com.android.tools.build:gradle:7.4.0

    【坑】導(dǎo)入項(xiàng)目報(bào)錯(cuò)Could not find com.android.tools.build:gradle:7.4.0

    報(bào)錯(cuò)的圖沒得了,反正就是Could not find com.android.tools.build:gradle:7.4.0 這個(gè)報(bào)錯(cuò)解決思路: 1、首先導(dǎo)入項(xiàng)目你不要直接File-----Open,你要FIle------New------Import Project 2、看你gradle配置 setting ----- Build,Exception,Deployment-------Gradle ①home是你下載的gradle路徑 ②Gradle 的JDK要和項(xiàng)目JDK一致

    2024年02月02日
    瀏覽(97)
  • android studio構(gòu)建項(xiàng)目報(bào)錯(cuò)Could not create an instance of type com.android.build.api.variant.impl.Applicat

    android studio構(gòu)建項(xiàng)目報(bào)錯(cuò)Could not create an instance of type com.android.build.api.variant.impl.Applicat

    Could not create an instance of type com.android.build.api.variant.impl.ApplicationVariantImpl 這個(gè)錯(cuò)誤通常是由于Gradle插件版本不兼容導(dǎo)致的。你可能正在使用的Gradle插件版本與你的Android Studio版本不兼容。 要解決這個(gè)問題,你可以嘗試以下解決方法: 在你的項(xiàng)目的build.gradle文件中,將com.andro

    2024年02月01日
    瀏覽(26)
  • 解決Android Studio 運(yùn)行時(shí)could not start avd

    解決Android Studio 運(yùn)行時(shí)could not start avd

    第一次在這里寫文章,很激動(dòng)哇!(雖然已經(jīng)大四了) 但是我非常想要和朋友們分享如何解決Android Studio 運(yùn)行時(shí)could not start avd的問題,因?yàn)槲仪袑?shí)體會(huì)到了急于解決問題但卻沒有辦法像只無頭蒼蠅似的,希望我可以幫助到盆友們! 話不多說,先來上圖 ? ?當(dāng)我在create devic

    2024年02月09日
    瀏覽(18)
  • 解決Android Studio-jdk版本不符問題(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

    解決Android Studio-jdk版本不符問題(No matching variant of com.android.tools.build:gradle:7.4.0 was found.)

    目錄 問題截圖: 錯(cuò)誤代碼: 錯(cuò)誤原因: 解決方法: 今天在打開項(xiàng)目的時(shí)候遇到了一些問題: 問題截圖: 錯(cuò)誤代碼: 如下: No matching variant of com.android.tools.build:gradle:7.4.0 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencie

    2024年02月11日
    瀏覽(98)
  • git解決ssh: Could not resolve hostname gitlab.xxxx.com

    報(bào)錯(cuò):ssh: Could not resolve hostname gitlab.xxxx.com: Name or service not known fatal: Could not read from remote repository. 解決如下:

    2024年02月09日
    瀏覽(20)

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

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

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

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包