Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

时间:2024-04-14 08:05:07

问题详情:

Android studio新建项目以后出现:
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+
Install Repository and sync project
Show in File
Show in Project Structure dialog
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

解决:这是因为sdk tools版本实际较低,默认版本较高

1、查看自己的sdk tools版本

File -> Settings -> Appearance & Behavior -> System Settings -> Updates -> Android SDK Tools (如图我这里版本是26)
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

2、如果没有显示项目列表(如下图)

则用快捷键alt+1
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

3、打开下图中文件build.gradle(Module:app)

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

4、按下图更改

Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

5、在如图位置点击try again,以sync(同步)【一定要记得】

这就相当于是你改完刷新一下。
Error:(26, 13) Failed to resolve: com.android.support:appcompat-v7:29.+问题解决

至此完成,报错消失


随手点赞的你真好看b( ̄▽ ̄)d~~~