- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试通过升级到 kotlin 1.7.20
来升级到 compose compiler 1.3.2
但我一直收到错误提示 Caused by: org.gradle .api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException:无法解析配置“:app:debugRuntimeClasspath”的所有文件。
我正在使用 android studio dolphin
如果我使用 kotlin 1.7.0
将我的 compose 编译器恢复到 1.2.0
,那么它工作正常。
根 gradle 文件。
buildscript {
ext {
compose_version = '1.3.2'
}
dependencies {
classpath "com.google.dagger:hilt-android-gradle-plugin:2.42"
}
}// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id 'com.android.application' version '7.3.0' apply false
id 'com.android.library' version '7.3.0' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用级gradle文件
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'dagger.hilt.android.plugin'
id 'kotlin-kapt'
}
android {
compileSdk 33
defaultConfig {
applicationId "com.affinidi.cealcompose"
minSdk 23
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion compose_version
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
namespace 'com.affinidi.cealcompose'
}
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
implementation 'androidx.activity:activity-compose:1.6.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_version"
//Splash screen
implementation 'androidx.core:core-splashscreen:1.0.0'
//Leak Canary
debugImplementation 'com.squareup.leakcanary:leakcanary-android:2.8.1'
//Compose Navigation
implementation("androidx.navigation:navigation-compose:2.5.2")
//Hilt
implementation("com.google.dagger:hilt-android:2.43")
kapt("com.google.dagger:hilt-compiler:2.43")
// implementation "androidx.fragment:fragment-ktx:1.5.1"
// implementation "androidx.activity:activity-ktx:1.5.1"
//Hilt Navigation
implementation("androidx.hilt:hilt-navigation:1.0.0")
//Accompanist
implementation("com.google.accompanist:accompanist-pager:0.25.0")
implementation("com.google.accompanist:accompanist-systemuicontroller:0.25.0")
}
不知道哪里出了问题。我正在为所有依赖项和插件使用最新的库,但不断收到错误
最佳答案
Compose 编译器和其他 Compose 依赖项具有 different releases .目前:
compose_compiler = '1.3.2'
compose_version = '1.2.1'
在您的 build gradle
文件中,您对所有这些文件使用相同的版本,其中一些不存在。
您可以轻松地在您的 build.gradle
脚本中使用不同的版本。
像这样的东西:
buildscript {
ext {
compose_compiler = '1.3.2'. //compiler
compose_version = '1.2.1'. //stable compose dependencies
compose_material3 = '1.0.0-rc01' //M3 releases
}
//...
}
然后在你的app/build.gradle
文件中
composeOptions {
kotlinCompilerExtensionVersion compose_compiler
}
dependencies {
//stable releases
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui:$compose_version"
//...other dipendencies
//material3 releases
implementation "androidx.compose.material3:material3:$compose_material3"
}
关于android - 由 : org. gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException 引起: ':app:debugRuntimeClasspath',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74160942/
我将Android Studio更新为3.6.3,但无法构建新应用,尤其是从离线模式构建应用。每当我尝试时,都会出现上述错误。我试图切换离线模式按钮,但无济于事。 这是我的 build.gradle
在我将项目中的 Android Studio 更新到 3.2.1 和 gradle 版本后,出现以下构建错误。 我已经检查了很多与此问题相关的问题,但没有运气。 项目依赖Build.gradle bu
我正在尝试通过升级到 kotlin 1.7.20 来升级到 compose compiler 1.3.2 但我一直收到错误提示 Caused by: org.gradle .api.internal.
我是一名优秀的程序员,十分优秀!