Android开发环境搭建遇到的BUG

bug1

问题描述 org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0

  1. Could not resolve all artifacts for configuration ‘:classpath’;

  2. could not find org.jetbrains.kotlin:kotlin-stdlib-jre8:1.2.0

    以上2种问题描述都是相同的问题

解决方法

将注释掉的jcenter()取消注释,简直奇葩,佛了。重点【已经错两次】

  repositories {
        google()
        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}//添加
        maven{url "https://jitpack.io"}//添加
        jcenter()
    }

bug2

问题描述

安装android studio报SDK tools directory is missing

参考

安装android studio报SDK tools directory is missing

https://stackoverflow.com/questions/28789556/android-studio-sdk-tools-directory-is-missing

解决 Android Studio 报SDK tools directory is missing

解决方法

  1. 将别人安装好的SDK复制到自己的SDK路径下

  2. Configure->Default Project Structure-> 按照如图所示设定SDK路径。

    image-20201217193538214

image-20201217193300146

bug3

问题描述

参考

AndroidStudio对应的Gradle插件从哪来?存放目录在哪?

Android Studio报错:Error:Could not find com.android.tools.build:gradle:4.1 记一次不长记性的坑

解决办法

image-20201217194344642

image-20201217194439730

因此本机的编译工具gradle:4.1.1路径 在如下所示位置。

C:\Users\21738\.gradle\caches\modules-2\files-2.1\com.android.tools.build\builder-model

build.gralde里的classpath 'com.android.tools.build:gradle:3.0.1'指的是Android Studio的gradle插件版本,而gradle-wrapper.properties里的distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip才是指定的gradle版本

Gradle是开源的自动化构建工具,而Gradle插件是google开发的在Android Studio中使用Gradle的插件。

gradle.org

bug4

build.grade中的阿里仓库虽然设置了,死活下载不成功,进度条疯狂在刷,2-3个小时都在同一个地方卡死。将http改成https【搜这个仓库时发现说这个阿里已经更新所以有这个疯狂的想法】。

//        maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}//添加
        maven{url 'https://maven.aliyun.com/nexus/content/groups/public/'}//添加

bug5

参考

解决Android 虚拟机运行The emulator process for AVD was killed.错误。

解决Android 虚拟机运行The emulator process for AVD was killed.错误。

Android studio报错:The emulator process for AVD (xxx) was killed

【Android】the emulator process was killed 以及 ANDROID_SDK_ROOT找不到或broken

设置SDK环境变量

原因

是因为用户名为中文,文件路径不能有中文,因此嗯哼~~

虚拟机无法启动

  1. 设置SDK环境变量,需要重启,对有些电脑来说,因为反应过慢,导致设置变量后无法及时更改,所以需要重启。

  2. 删除用户文件夹下的.android文件夹。

  3. 启动虚拟机

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值