AndroidStudio 入门第一个程序爬坑!! Could not resolve all artifacts for configuration ':classpath'.
2020-03-08 14:13
11030 查看
情况说明
在对AndroidStudio安装部署以后,对helloworld的程序进行运行时,出现了错误,这些错误我没在网上找到,但是在请教了身边人后得到了解决,特此记录来帮助刚刚入门的新手来爬坑(有错误的地方欢迎指出谢谢!)
正文开始
一、AndroidStudio的安装
首先我们是按照基本教程对AndroidStudio进行安装(作为程序员咱们就简单点)由于版权的原因在这我就不链接其他的人的文章了,如有需要请大家搜索AndroidStudio的安装。
二、我们需要运行我们的第一个程序helloworld
- 标我们点击第一个选项Start a new Android Studio project创建一个项目题
- 选择EmptyActivity,然后点击Next
- 如图输入然后点击finish
- 这一步完成后如何你的软件没有问题则可以正常运行了,但是如果你发现的你项目报错了,就请继续往下看;
三、如果出现以下情况:(现在才是正文前面有点啰嗦了)
现在我们需要做的是
1、确保你的jdk/sdk路径设置正确,如图所示
2、确保java的环境变量配置是否正确
3、当前面两步骤都没问题后,切依然出错时,点击file->Sync With File System
4、将下载的源设置为阿里的镜像,如图所示:
具体代码为:
[code] buildscript { repositories { maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'} google() //jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.6.0' // 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() } }
最后点击file->close project然后重新进入项目就可以解决问题了
问题说明:
当我们在安装AndroidStudio的时候在线安装sdk时,由于网络的原因可能会导致文件安装的缺失,我们通过Sync with file System进行文件补全,并且将下载源设置为阿里镜像,这样就不会存在由于网络原因导致安装文件补全的问题。希望这个文章可以对您的学习有一点点的帮助!有任何问题欢迎私信或者留言进行沟通(第一次写文章有所不好的地方请各位多包含)
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- Error:Could not resolve all dependencies for configuration ':app:prodDebugCompileClasspath'. Cannot
- Could not resolve all files for configuration ':classpath'.Could not find com.android.tools.
- Could not resolve all files for configuration ':app:debugCompileClasspath'
- Could not resolve all dependencies for configuration ':classpath'.
- 更换gradle,引起文件缺失报错 Could not resolve all dependencies for configuration ':classpath'.
- Could not resolve all files for configuration ':classpath'.Could not find com.android.tools.
- Could not resolve all dependencies for configuration ':classpath'.
- Error:Unable to resolve dependency for ':@debug/compileClasspath',Could not resolve project
- 解决Unable to resolve dependency for ‘:app@debug/compileClasspath’: Could not resolve com.android.supp
- databus编译:Could not resolve all dependencies for configuration ':databus2-relay:databus2-event-producer-mock:compile
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
- Unable to resolve dependency for :app@debug/compileClasspath': Could not resolve com.***问题解决
- 解决ionic编译android支持问题> Could not resolve all dependencies for configuration ':_debugCompile'. > Co
- 将Crosswalk插件添加到Cordova项目后Could not resolve all dependencies for configuration ':_armv7DebugCompile'
- Could not resolve all files for configuration;Andriod在build.gradle添加compile files()报错
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
- ionic 安装cordova-plugin-crosswalk-webview,报Could not resolve all dependencies for configuration ':_ar
- 【已解决】could not resolve all dependencies for configuration ':claapath'
- Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.suppor
- Error:Could not resolve all files for configuration ...