Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Kotlin 查找jetpack compose编译器时出错。找不到androidx。compose:compose编译器:1.0.0-alpha11_Kotlin_Android Jetpack_Android Jetpack Compose - Fatal编程技术网

Kotlin 查找jetpack compose编译器时出错。找不到androidx。compose:compose编译器:1.0.0-alpha11

Kotlin 查找jetpack compose编译器时出错。找不到androidx。compose:compose编译器:1.0.0-alpha11,kotlin,android-jetpack,android-jetpack-compose,Kotlin,Android Jetpack,Android Jetpack Compose,我在一个android项目中遇到了这个错误 Could not find androidx.compose:compose-compiler:1.0.0-alpha11. Searched in the following locations: - https://maven.google.com/androidx/compose/compose-compiler/1.0.0-alpha11/compose-compiler-1.0.0-alpha11.pom - https://

我在一个android项目中遇到了这个错误

Could not find androidx.compose:compose-compiler:1.0.0-alpha11.
 Searched in the following locations:
   - https://maven.google.com/androidx/compose/compose-compiler/1.0.0-alpha11/compose-compiler-1.0.0-alpha11.pom
   - https://jcenter.bintray.com/androidx/compose/compose-compiler/1.0.0-alpha11/compose-compiler-1.0.0-alpha11.pom
   - https://repo.maven.apache.org/maven2/androidx/compose/compose-compiler/1.0.0-alpha11/compose-compiler-1.0.0-alpha11.pom
正如您所看到的,我已经在教程的基础上添加了google存储库

构建梯度的配置如下所示:

build.gradle.kts

dependencies {
val composeVersion = "1.0.0-alpha11"
//val composeVersion = "0.1.0-dev10"
implementation(project(":shared"))
//implementation ("androidx.compose.runtime:runtime:$composeVersion")
//implementation ("androidx.compose.compiler:compiler:$composeVersion")
implementation("com.google.android.material:material:1.2.1")
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("androidx.constraintlayout:constraintlayout:2.0.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.2")


implementation ("androidx.compose.ui:ui:$composeVersion")
// Tooling support (Previews, etc.)
//implementation ("androidx.compose.ui:ui-tooling:$composeVersion")
// Foundation (Border, Background, Box, Image, Scroll, shapes, animations, etc.)
implementation ("androidx.compose.foundation:foundation:$composeVersion")
// Material Design
implementation ("androidx.compose.material:material:$composeVersion")
// Material design icons
implementation ("androidx.compose.material:material-icons-core:$composeVersion")
implementation ("androidx.compose.material:material-icons-extended:$composeVersion")
// Integration with observables
implementation ("androidx.compose.runtime:runtime-livedata:$composeVersion")
implementation ("androidx.compose.runtime:runtime-rxjava2:$composeVersion")

 //UI Tests
//androidTestImplementation 'androidx.compose.ui:ui-test-junit4:1.0.0-alpha10'
}

android {
   compileSdkVersion(29)
   defaultConfig {
    applicationId = "com.myTempOrg.myTestApp.androidApp"
    minSdkVersion(24)
    targetSdkVersion(29)
    versionCode = 1
    versionName = "1.0"
}
buildFeatures {
    compose = true
}

composeOptions {
    kotlinCompilerVersion = "1.4.21"
    kotlinCompilerExtensionVersion = "1.0.0-alpha11"
}

kotlinOptions {
    jvmTarget = "1.8"
    useIR = true
}

我还尝试降级到alpha03,似乎找到了,但由于缺少依赖项,出现了另一系列问题。

kotlinCompilerVersion应该是“1.4.21-2”,alpha 11

请注意,alpha 12现已推出,您可以使用以下依赖项进行升级:


您还需要添加以下内容:

发布您的项目
build.gradle