AS升级到Arctic Fox版本遇到的问题

16 篇文章 0 订阅

1、gradle 的仓库地址不安全警告

警告信息:

Using insecure protocols with repositories, without explicit opt-in, has been deprecated. This is scheduled to be removed in Gradle 7.0. Switch Maven repository 'm
aven(http://maven.aliyun.com/nexus/content/groups/public/)' to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/6.8.3/dsl/or
g.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.
Configuration on demand is an incubating feature.

解决办法:使用 allowInsecureProtocol 属性

repositories {
	...
    maven {
        allowInsecureProtocol = true
        ...
    }
}

2、Android Gradle plugin requires Java 11

错误信息:

An exception occurred applying plugin request [id: 'com.android.application']
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

解决版本:
AGP 7.0.0-alpha02起需要使用Java 11
https://developers-jp.googleblog.com/2020/12/announcing-android-gradle-plugin.html

说明:AS Arctic Fox版本自带java 11

AndroidStudio > File > Setting >File | Settings | Build, Execution, Deployment > Build Tools >Gradle>Add JDK
选中 AS安装目录 下的 jre文件夹 即可。
在这里插入图片描述

3、依赖包下载失败问题

Execution failed for task ':app:mergeDebugNativeLibs'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.codersun:fingermanager:1.0.0.
     Searched in the following locations:

解决方法:
添加jcenter()仓库,虽然提示过时,但是有些库还未从这里面迁移出来,还得继续使用;

    repositories {
        jcenter()
    }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值