【发布时间】:2021-04-25 10:09:33
【问题描述】:
大家好,我在 kotlin 中使用 jetpack compose 制作了一个应用程序,但是当我运行该应用程序时,它给了我这个错误。
“任务':app:compileDebugKotlin'执行失败。
无法解析配置 ':app:kotlin-extension' 的所有文件。 找不到 androidx.compose.compiler:compiler:0.1.0-dev07。 在以下位置搜索: - https://dl.google.com/dl/android/maven2/androidx/compose/compiler/compiler/0.1.0-dev07/compiler-0.1.0-dev07.pom - https://jcenter.bintray.com/androidx/compose/compiler/compiler/0.1.0-dev07/compiler-0.1.0-dev07.pom - https://jitpack.io/androidx/compose/compiler/compiler/0.1.0-dev07/compiler-0.1.0-dev07.pom 要求: 项目:应用程序
可能的解决方案:
- 声明提供工件的存储库,请参阅https://docs.gradle.org/current/userguide/declaring_repositories.html 上的文档 "
这是我的代码(build-gradle):
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.github.zsoltk.pokedex"
minSdkVersion 21
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion "0.1.0-dev07"
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.core:core-ktx:1.3.2'
implementation "androidx.lifecycle:lifecycle-livedata:2.3.1"
implementation 'androidx.ui:ui-framework:0.1.0-dev07'
implementation 'androidx.ui:ui-layout:0.1.0-dev07'
implementation 'androidx.ui:ui-foundation:0.1.0-dev07'
implementation 'androidx.ui:ui-material:0.1.0-dev07'
implementation 'androidx.ui:ui-tooling:0.1.0-dev07'
implementation 'com.github.zsoltk:compose-router:0.7.0'
implementation "io.reactivex.rxjava2:rxjava:2.2.17"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
buildscript {
ext.kotlin_version = "1.3.61"
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.0-alpha14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
对我需要做什么有任何想法吗?
【问题讨论】:
-
您应该更新所有依赖项以使用最新的 1.0.0-beta05
标签: android kotlin androidx android-jetpack-compose