AS Notes|记录日常开发遇到的 AS 问题(不断更新。。。
Posted HLQ_Struggle
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AS Notes|记录日常开发遇到的 AS 问题(不断更新。。。相关的知识,希望对你有一定的参考价值。
theme: channing-cyan
我们走过了青春,却离别在了秋季。。。
先放一张目前 android Studio 版本图:
占楼,看了下掘金之前草稿箱出现图片丢失情况,先发文,后续慢慢更新…
1、Git 显示乱码
之前出现过这个问题,主要是因为字体原因,这次尝试一波:
选择字体之后,点击 Apply 并 Ok,再回头看:
2、Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
错误日志如下:
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`.
Gradle settings
根目录下输入如下命令查看版本信息:
- ./gradlew --version
输出如下:
Welcome to Gradle 7.0.2!
Here are the highlights of this release:
- File system watching enabled by default
- Support for running with and building Java 16 projects
- Native support for Apple Silicon processors
- Dependency catalog feature preview
For more details see https://docs.gradle.org/7.0.2/release-notes.html
------------------------------------------------------------
Gradle 7.0.2
------------------------------------------------------------
Build time: 2021-05-14 12:02:31 UTC
Revision: 1ef1b260d39daacbf9357f9d8594a8a743e2152e
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_211 (Oracle Corporation 25.211-b12)
OS: Mac OS X 10.16 x86_64
按照如下路径修改 JDK 版本为 11:
- Preferences > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK
随后将 build 中的 JDK 版本做替换:
android
// ...
compileOptions
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
kotlinOptions
jvmTarget = '11'
THK
以上是关于AS Notes|记录日常开发遇到的 AS 问题(不断更新。。。的主要内容,如果未能解决你的问题,请参考以下文章
AS Notes|记录日常开发遇到的 AS 问题(不断更新。。。
AS Notes|记录日常开发遇到的 AS 问题(不断更新。。。