Android ERROR: Failed to resolve: com.github.**** 报错

这篇具有很好参考价值的文章主要介绍了Android ERROR: Failed to resolve: com.github.**** 报错。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

在运行android项目时,总是报错,提示:Android ERROR: Failed to resolve: com.github.****

我原来的build.gradle文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {


    repositories {
        google()
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.0.1'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

}

allprojects {
    repositories {
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}
        google()
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

可能是项目的Build.gradle 的 maven 仓库的配的位置不对,更改了之后就可以了

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {

        google()
        jcenter()
//        maven { url 'https://www.jitpack.io' } 把这个放到下面,立马就好了。
        mavenCentral()
        maven { url 'https://repo1.maven.org/maven2/' }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:4.0.1"   //这个一定要注意,原文件是4.0.1这里也是4.0.1,要一致;

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
        maven { url 'https://jitpack.io' }
        mavenCentral()
        maven { url 'https://repo1.maven.org/maven2/' }
        maven { url "https://oss.jfrog.org/libs-snapshot" }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

更改了之后我的项目就可以顺利运行了(参考)。文章来源地址https://www.toymoban.com/news/detail-758227.html


到了这里,关于Android ERROR: Failed to resolve: com.github.**** 报错的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • clone报错fatal: unable to access ‘https://github.com/...‘: Failed to connect to github.com port

    原因是本机代理端口和git端口不一致。 第一步、找到本机代理端口号(红框部分) 第二步、修改git端口号 在git-bash执行如下两条指令 问题解决! [1][报错解决] Failed to connect to github.com port 443 after ***** ms: Couldn‘t connect to server [2]GitHub 新手详细教程

    2024年02月06日
    浏览(43)
  • 解决Build failed:Could not resolve com.android.tools.build:gradle:XXX

    先创建的项目在build时出现下面的报错: 原因:此为Android Studio默认的JDK版本与项目配置的Gradle所需的JDK不一致导致冲突所致。要求选择同一版本的JDK。 解决方案:点击File --Project Structure -SDK Location-JDK location gradle Settings,将Gradle user home和项目的Gradle JDK改为一样的版本目录。

    2024年02月11日
    浏览(38)
  • Git clone报错:fatal: unable to access ‘https://github.com/.....‘: Failed to connect to github.com port

    使用Git克隆项目是,有时候会报错:Failed to connect to github.com port 443 after 21096 ms: Couldn’t connect to server 原因是本机代理端口和git端口不一致。 我的解决方法: 然后开启手动代理模式: 随便在哪个地方,右键选择Git Bash Here(得安装了Git),然后在弹出的命令行窗口中分别输入一

    2024年04月13日
    浏览(52)
  • 解决 github 报错 Failed to connect to github.com port 443:connection timed out

    你在使用github的时候,是不是会经常出现Failed to connect to github.com port 443:connection timed out报错,这是什么原因造成的呢?我们应该如何解决呢?请继续往下看 这是由于电脑里开启了代理,例如开启了翻墙软件等,就会造成这个原因 执行命令:

    2024年02月11日
    浏览(46)
  • it报错: Failed to connect to github.com port 443 解决方案

    转自: Git报错: Failed to connect to github.com port 443 解决方案-CSDN博客 两种情况: 第一种情况自己有vpn,网页可以打开github。说明命令行在拉取/推送代码时并没有使用vpn进行代理 第二种情况没有vpn,这时可以去某些网站上找一些代理ip+port 解决办法:配置http代理Windows、Linux、

    2024年01月19日
    浏览(26)
  • Git报错: Failed to connect to github.com port 443 解决方案

    两种情况: 第一种情况自己有vpn ,网页可以打开github。说明命令行在拉取/推送代码时并没有使用vpn进行代理 第二种情况没有vpn ,这时可以去某些网站上找一些代理ip+port 解决办法:配置http代理Windows、Linux、Mac OS 中 git 命令相同: 配置socks5代理 配置http代理 注意: 命令中的

    2024年02月11日
    浏览(49)
  • 【git】Git提交或者报错fatal:unable to access ‘https://github.com/xxx‘: Failed to connect to github.com

    1. 问题原因 报错信息: 原因: 在git push时或者clone时,中间会有git的http和https代理,但是我们本地环境本身就有SSL协议了,所以取消git的https或者http代理即可 2. 解决方案 最好的解决方法还是配置ssh方法访问 链接:Github配置SSH访问 避免使用https访问经常网络连接失败或者需要

    2024年02月05日
    浏览(37)
  • Android Studio报错:Could not resolve com.android.tools.build:gradle:8.0.0

    Android Studio 新建项目会报以下错误: 完整版报错信息如下: 原因:此为Android Studio默认的JDK版本与项目配置的Gradle所需的JDK不一致导致冲突所致。要求选择同一版本的JDK,可以选择Android Studio自带的jdk17。 解决方案:点击File --Project Structure -SDK Location-JDK location gradle Settings,将

    2024年02月11日
    浏览(38)
  • git报错:Failed to connect to github.com port 443: Timed out

    git push代码时,报错 接着发现无法ping通github.com 思路 修改hosts文件,让主机跳过DNS服务器,直接根据hosts配置信息替换域名 步骤 1、在ipaddress.com查询Github真实IP地址 2、打开hosts文件,一般位于 C:WindowsSystem32driversetchosts ,添加如下配置 3、再ping一下,成功! 而后正常push代码

    2024年01月20日
    浏览(50)
  • 报错解决:Failed to connect to github.com port 443: Connection refuesd

    今天在用git下载时遇到错误: Cloning into \\\'xxxxx\\\'... fatal: unable to access \\\'https://github.com/xxxxxxxx.git/\\\': Failed to connect to github.com port 443: Connection refused 查询后尝试以下方法解决: 1.查看自己的本机系统代理(设置---网络和Internet---代理---地址:端口): 2.修改git配置:(其中的xxxx改为你

    2024年02月04日
    浏览(42)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包