ComposewithHiltlastversion(2.35)问题:无法找到方法

我正在尝试在 Android Canary 上使用 Compose 和 Hilt(最新版本),但我无法同步该项目。错误信息如下:

Unable to find method ''void com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTests$default(com.android.build.api.extension.AndroidComponentsExtension, com.android.build.api.extension.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)''
'void com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTests$default(com.android.build.api.extension.AndroidComponentsExtension, com.android.build.api.extension.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)'

我的 build.gradle

ext {
        compose_version = '1.0.0-beta01'
    }
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.1.0-alpha01'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.30"
        def hilt_version = "2.35"
        classpath "com.google.dagger:hilt-android-gradle-plugin:$hilt_version"
    }

我的 build.gradle(:app)

    //Dagger - Hilt
    def hilt_version = "2.35"
    implementation "com.google.dagger:hilt-android:$hilt_version"
    kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
    implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
    kapt "androidx.hilt:hilt-compiler:1.0.0"
    implementation 'androidx.hilt:hilt-navigation-compose:1.0.0-alpha02'

回答

更新到刀柄版本2.36似乎已经为我解决了这个问题。


以上是ComposewithHiltlastversion(2.35)问题:无法找到方法的全部内容。
THE END
分享
二维码
< <上一篇
下一篇>>