【发布时间】:2021-05-22 12:37:40
【问题描述】:
我正准备将支持 SDK 更新到最新版本的 Android,即 SDK 31 "S",但 Gradle 同步存在一些问题。
错误
Failed to notify build listener.
Could not resolve all dependencies for configuration ':app:debugRuntimeClasspath'.
Could not create task ':app:minifyDebugWithR8'.
Cannot query the value of this provider because it has no value available.
Failed to stop service 'com.android.build.gradle.internal.errors.SyncIssueReporterImpl$GlobalSyncIssueService_5d47b2c0-a1a4-43ab-bbdb-bb6abdacb3ba'.
Failed to find Platform SDK with path: platforms;android-31
这是设置
compileSdk 31
defaultConfig {
applicationId "com.app.app
minSdk 21
targetSdk 31
versionCode 7
versionName "1.0.9"
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
已经在使用最新的 AGP com.android.tools.build:gradle:7.1.0-alpha01
终于有了最新的AS版本预览
Android Studio Bumblebee | 2021.1.1 金丝雀 1 构建 #AI-203.7717.56.2111.7361063,构建于 2021 年 5 月 14 日
在documentation 之后效果不佳。
No signature of method: build_cdzmabn9imuzupf8f433s2vnq.android() is applicable for argument types: (build_cdzmabn9imuzupf8f433s2vnq$_run_closure1) values: [build_cdzmabn9imuzupf8f433s2vnq$_run_closure1@6f573027]
Gradle 同步成功
compileSdkPreview "android-S"
targetSdkPreview "S"
但该应用程序根本无法安装在任何设备上,无论是发布还是调试。
我们还应该做什么?
【问题讨论】:
-
你还在面对这个问题吗?
-
@HamidShatu 不确定是否再试一次,因为它看起来还没有准备好投入生产。
标签: android android-12