kotlin 升级targetSdkVersion到34后出现故障

m1m5dgzv  于 2023-10-23  发布在  Kotlin
关注(0)|答案(1)|浏览(425)

我坚持这个错误一个星期。在我尝试将应用程序的targetSdkVersion从30更新为34之后,我得到了一个错误

Execution failed for task ':app:kaptDevelopDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptWithoutKotlincTask$KaptExecutionWorkAction
   > java.lang.reflect.InvocationTargetException (no error message)

我试着升级我的第三方库版本。我也检查了我的代码,没有错误。我试过很多方法,但都没用。关于这个案子你们能给予点建议吗?
这是我所有的依赖。

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.google.android.material:material:1.9.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.3.1'
    implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
    implementation 'androidx.paging:paging-runtime-ktx:3.2.1'
//    implementation 'androidx.room:room-runtime:2.5.2'
//    annotationProcessor  'androidx.room:room-compiler:2.5.2'
    def lifecycle_version = "2.6.2"
    implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
    implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"

    def room_version = "2.5.2"
    implementation "androidx.room:room-runtime:$room_version"
    kapt "androidx.room:room-compiler:$room_version"

//
//    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
//    implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
//    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'

    //network call
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.19'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11'
    implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11'

    //Carousel View
    implementation 'com.synnapps:carouselview:0.1.5'

    //view binding
    implementation 'com.jakewharton:butterknife:10.2.3'
    annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
    kapt 'com.jakewharton:butterknife-compiler:10.2.3'

    //error log
    implementation 'com.jakewharton.timber:timber:5.0.1'

    //load image
    implementation 'com.squareup.picasso:picasso:2.71828'

    //circle image view
    implementation 'com.pkmmte.view:circularimageview:1.1'

    //firebase
//    implementation('com.crashlytics.sdk.android:crashlytics:2.10.1') {
//        transitive = true
//    }
//    implementation 'com.google.firebase:firebase-core:17.5.1'
    implementation 'com.google.firebase:firebase-analytics:21.3.0'
    implementation 'com.google.firebase:firebase-crashlytics:18.4.3'

    //check network
    implementation 'com.github.pwittchen:reactivenetwork-rx2:3.0.8'

    //buttom dialog
    implementation 'com.github.javiersantos:BottomDialogs:1.2.1'

    //video player
    def exo_player_version = "2.11.0"
//    //noinspection GradleDependency
    implementation "com.google.android.exoplayer:exoplayer-core:$exo_player_version"
//    //noinspection GradleDependency
    implementation "com.google.android.exoplayer:exoplayer-hls:$exo_player_version"
//    //noinspection GradleDependency
    implementation "com.google.android.exoplayer:exoplayer-ui:$exo_player_version"

//    implementation "androidx.media3:media3-exoplayer:1.1.1"
//    implementation "androidx.media3:media3-exoplayer-dash:1.1.1"
//    implementation "androidx.media3:media3-ui:1.1.1"

    //save instance stage
    implementation 'frankiesardo:icepick:3.2.0'
    kapt 'frankiesardo:icepick-processor:3.2.0'

    //loading progress
    implementation 'com.wang.avi:library:2.1.3'

    //in app web view
    implementation 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'

    //add custom font
    implementation 'io.github.inflationx:calligraphy3:3.1.1'
    implementation 'io.github.inflationx:viewpump:2.1.1'

    //app drawer
    implementation('com.mikepenz:materialdrawer:7.0.0')
    implementation 'com.mikepenz:fontawesome-typeface:4.7.0.1@aar'

    //search view
    implementation 'com.miguelcatalan:materialsearchview:1.4.0'

    //video 16:9 layout
    implementation 'com.ritesh:ratiolayout:1.0.0'

    //toast
    implementation 'com.github.GrenderG:Toasty:1.2.5'

    //bottom navigation
    implementation 'com.aurelhubert:ahbottomnavigation:2.3.4'

    //shimmer
    implementation 'com.github.sharish:ShimmerRecyclerView:v1.3'

    //mutidex
    implementation 'androidx.multidex:multidex:2.0.1'

    //kotlin
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"

    //buttomsheet
    implementation 'com.github.rubensousa:bottomsheetbuilder:1.6.1'
    implementation 'androidx.media:media:1.6.0'
    implementation 'org.greenrobot:eventbus:3.3.1'

    //In-app update
    implementation 'com.google.android.play:core:1.10.3'

    //App oauth
    implementation 'net.openid:appauth:0.11.1'

    //debug lib
    debugImplementation 'com.amitshekhar.android:debug-db:1.0.1'
    def work_version = "1.0.1"
    implementation "android.arch.work:work-runtime:$work_version"

    // App's dependencies, including test
    implementation 'androidx.annotation:annotation:1.7.0'
    implementation 'com.google.android.gms:play-services-analytics:18.0.3'

    //Google billing
    implementation 'com.android.billingclient:billing:6.0.1'

    //UI Testing with Espresso
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    androidTestImplementation 'androidx.test:runner:1.5.2'
    androidTestImplementation 'androidx.test:rules:1.5.0'
    implementation 'androidx.test.espresso:espresso-idling-resource:3.5.1'

    // include espresso-intents
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
}

和我的gradle.properties

org.gradle.jvmargs=-Xmx2056m
android.defaults.buildfeatures.buildconfig=true
android.useAndroidX=true
android.enableJetifier=true
kapt.use.worker.api=false
kapt.incremental.apt=false

依赖类路径

dependencies {
        classpath 'com.android.tools.build:gradle:8.1.2'
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0'
        classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9'
        classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
        classpath 'com.google.gms:google-services:4.4.0'
    }

Gradle版本为8.0
Error shown

tvokkenx

tvokkenx1#

1.检查Gradle中的Kapt版本
1.使用--stackTrace获取错误的详细描述。
这可能是由于API冲突导致的版本兼容性问题。请参阅此链接,如果它有帮助。A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
谢谢

相关问题