IT技术之家

首页 > 移动

移动

Android Studio 针对部分导入项目报错的问题解决方案_导入project出错android studio_伊伊一颗菜

发布时间:2023-11-28 20:38:21 移动 34次 标签:android studio
android studio 项目导入会报错 针对个别问题的解决方案...

Android Studio

用于自学总结 防止二次踩坑


相关知识点

(2条消息) 如何创建android studio项目及线性布局_菜鸟码农阿庆的博客-CSDN博客_android studio线性布局

(2条消息) 安卓18:Android Studio界面布局相关项目总结_@thelakes的博客-CSDN博客_android studio项目总结

(2条消息) Android RecyclerView最全使用详解_Teacher.Hu的博客-CSDN博客_android recyclerview


导入一个新项目会报错

有以下几个注意点:

问题一:由于Android Gradle plugin 需要 Java 11,而环境变量所配置的 JDK 是1.8 ,所以尝试更改JDK 配置





最后点击File–>Sync Project with Grade Files


问题二:

We recommend using a newer Android Gradle plugin to use compileSdk = 33

This Android Gradle plugin (7.1.2) was tested up to compileSdk = 32

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=33
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 33

翻译即:

我们建议使用一个更新的Android Gradle插件来使用compileSdk = 33
这个Android Gradle插件(7.1.2)已经经过了compileSdk = 32的测试
可以通过添加来抑制此警告
android.suppressUnsupportedCompileSdk = 33
到这个项目的gradle.properties
构建将继续进行,但强烈建议您将项目更新为
使用使用compileSdk = 33测试过的更新的Android Gradle Plugin

大意是得更新到compileSdk = 33

解决方法参考:

(7条消息) Android Studio | 修改CompileSDKVersion | 修改targetSdkVersion_stone_fall的博客-CSDN博客


问题三:

 Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin 'com.android.internal.application'.

在gradle.properties添加 android.overridePathCheck=true即可

如图

解决方法:参考(7条消息) 解决Gradle报错Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plu_甜心超人ww的博客-CSDN博客

有坑会后续再补…