小编jor*_*uke的帖子

如何通过Jetpack compose展示原生广告?

我一直在寻找有关如何在撰写时显示原生广告的示例应用程序,但我找不到。有什么解决办法吗?

admob native-ads android-jetpack-compose

7
推荐指数
1
解决办法
3332
查看次数

Compose with Hilt last version (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)'

Run Code Online (Sandbox Code Playgroud)

我的 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"
    }
Run Code Online (Sandbox Code Playgroud)

我的 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'
Run Code Online (Sandbox Code Playgroud)

android kotlin dagger dagger-hilt

2
推荐指数
1
解决办法
707
查看次数