将我的 Android Studio 更新到最新版本后即电鳗 | 2022年1月1日,我在创建新项目后收到“Gradle项目同步失败” 。
错误:
A problem occurred configuring root project 'BIAssignment'.
> Could not resolve all files for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:7.4.0.
Required by:
project : > com.android.application:com.android.application.gradle.plugin:7.4.0
project : > com.android.library:com.android.library.gradle.plugin:7.4.0
> No matching variant of com.android.tools.build:gradle:7.4.0 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' …Run Code Online (Sandbox Code Playgroud) 就像标题所说,我使用的是 Android Studio Electric eel 2022.1.1 Patch 1,每当我启动调试器时,它都会运行 1 或 2 个断点,之后应用程序会进入 ANR,观察者会陷入评估困境。停止调试器时,会弹出“等待进程正常完成”的消息。我尝试使缓存无效并清除所有断点,但仍然没有成功。同一个项目在 AS 上次更新中运行良好。
当我更新到 Electric Eel 2022.1.1 时,每次创建新的 Kotlin 文件时,都会收到通知 warning Configure Kotlin Configure 'Name.app' module in 'Name' project asKotlin (Android with Gradle) module。
我只使用过 Kotlin,没有使用过 Java。我是在更新后才开始收到此警告的。
在我单击链接配置为 Kotlin(带有 Gradle 的 Android)模块并选择包含 Kotlin 文件的所有模块: Name.app并将 Kotlin 编译器设置为1.8.0后,当我创建新文件时,它仍然会再次发出警告。
我需要担心这个警告还是可以忽略它?
这是我的 build.gradle (:app)
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}
android {
namespace 'com.example.name'
compileSdk 33
defaultConfig {
applicationId "com.example.name"
minSdk 23
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false …Run Code Online (Sandbox Code Playgroud)