Failed to resolve: support-core-utils & Failed to resolve: appcompat

本文介绍了解决在Android Studio中遇到的Failed to resolve错误的方法。通过在allprojects中添加特定的Maven仓库URL,可以有效解决依赖问题,确保项目顺利运行。

今日运行 Android Studio 项目时候报了个 Failed to resolve 错误;

解决方法:

把 allprojects 中 添加 maven { url 'https://maven.google.com' }

allprojects {
    repositories {
        maven { url 'https://maven.google.com' }
        jcenter()
        maven { url "https://jitpack.io" }
        maven { url 'http://developer.huawei.com/repo/' }
        mavenCentral() // add repository
        google()
    }
}

注意:需把 maven { url 'https://maven.google.com' } 放到最上边。

vmuser@ubuntu:~$ sudo apt-get install device-tree-compiler Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: clang fcitx fcitx-bin fcitx-config-common fcitx-config-gtk fcitx-data fcitx-frontend-all fcitx-frontend-gtk2 fcitx-frontend-gtk3 fcitx-frontend-qt5 fcitx-module-dbus fcitx-module-kimpanel fcitx-module-lua fcitx-module-x11 fcitx-modules fcitx-ui-classic libbotan-2-4 libegl1-mesa-dev libfcitx-config4 libfcitx-core0 libfcitx-gclient1 libfcitx-qt5-1 libfcitx-utils0 libgettextpo0 libgles2-mesa-dev libglu1-mesa-dev liblua5.2-0 libopencc2 libopencc2-data libpresage-data libpresage1v5 libqbscore1.10 libqbsqtprofilesetup1.10 libqt4-qt3support libqt5concurrent5 libqt5designer5 libqt5designercomponents5 libqt5help5 libqt5opengl5 libqt5quicktest5 libqt5quickwidgets5 libqt5script5 libqt5sql5 libqt5sql5-sqlite libqt5test5 libqt5xml5 libqt5xmlpatterns5 libqtwebkit4 libtinyxml2.6.2v5 libtspi1 libwayland-bin libwayland-dev presage qbs-common qml-module-qtgraphicaleffects qml-module-qtqml-models2 qml-module-qtquick-controls qml-module-qtquick-layouts qml-module-qtquick-window2 qml-module-qtquick2 qtcreator-data qtcreator-doc Use 'sudo apt autoremove' to remove them. The following NEW packages will be installed: device-tree-compiler 0 upgraded, 1 newly installed, 0 to remove and 301 not upgraded. Need to get 239 kB of archives. After this operation, 441 kB of additional disk space will be used. Err:1 http://mirrors.aliyun.com/ubuntu bionic/main amd64 device-tree-compiler amd64 1.4.5-3 Could not resolve 'mirrors.aliyun.com' E: Failed to fetch http://mirrors.aliyun.com/ubuntu/pool/main/d/device-tree-compiler/device-tree-compiler_1.4.5-3_amd64.deb Could not resolve 'mirrors.aliyun.com' E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
最新发布
11-10
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值