kotlin 升级targetSdkVersion到34后出现故障

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

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

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

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

  1. dependencies {
  2. implementation fileTree(include: ['*.jar'], dir: 'libs')
  3. implementation 'com.google.android.material:material:1.9.0'
  4. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  5. implementation 'androidx.appcompat:appcompat:1.6.1'
  6. implementation 'androidx.cardview:cardview:1.0.0'
  7. implementation 'androidx.recyclerview:recyclerview:1.3.1'
  8. implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
  9. implementation 'androidx.paging:paging-runtime-ktx:3.2.1'
  10. // implementation 'androidx.room:room-runtime:2.5.2'
  11. // annotationProcessor 'androidx.room:room-compiler:2.5.2'
  12. def lifecycle_version = "2.6.2"
  13. implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
  14. implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
  15. def room_version = "2.5.2"
  16. implementation "androidx.room:room-runtime:$room_version"
  17. kapt "androidx.room:room-compiler:$room_version"
  18. //
  19. // implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
  20. // implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.6.2'
  21. // implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2'
  22. //network call
  23. implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  24. implementation 'io.reactivex.rxjava2:rxjava:2.2.19'
  25. implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
  26. implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  27. implementation 'com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.11'
  28. implementation 'com.squareup.okhttp3:okhttp:5.0.0-alpha.11'
  29. //Carousel View
  30. implementation 'com.synnapps:carouselview:0.1.5'
  31. //view binding
  32. implementation 'com.jakewharton:butterknife:10.2.3'
  33. annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.3'
  34. kapt 'com.jakewharton:butterknife-compiler:10.2.3'
  35. //error log
  36. implementation 'com.jakewharton.timber:timber:5.0.1'
  37. //load image
  38. implementation 'com.squareup.picasso:picasso:2.71828'
  39. //circle image view
  40. implementation 'com.pkmmte.view:circularimageview:1.1'
  41. //firebase
  42. // implementation('com.crashlytics.sdk.android:crashlytics:2.10.1') {
  43. // transitive = true
  44. // }
  45. // implementation 'com.google.firebase:firebase-core:17.5.1'
  46. implementation 'com.google.firebase:firebase-analytics:21.3.0'
  47. implementation 'com.google.firebase:firebase-crashlytics:18.4.3'
  48. //check network
  49. implementation 'com.github.pwittchen:reactivenetwork-rx2:3.0.8'
  50. //buttom dialog
  51. implementation 'com.github.javiersantos:BottomDialogs:1.2.1'
  52. //video player
  53. def exo_player_version = "2.11.0"
  54. // //noinspection GradleDependency
  55. implementation "com.google.android.exoplayer:exoplayer-core:$exo_player_version"
  56. // //noinspection GradleDependency
  57. implementation "com.google.android.exoplayer:exoplayer-hls:$exo_player_version"
  58. // //noinspection GradleDependency
  59. implementation "com.google.android.exoplayer:exoplayer-ui:$exo_player_version"
  60. // implementation "androidx.media3:media3-exoplayer:1.1.1"
  61. // implementation "androidx.media3:media3-exoplayer-dash:1.1.1"
  62. // implementation "androidx.media3:media3-ui:1.1.1"
  63. //save instance stage
  64. implementation 'frankiesardo:icepick:3.2.0'
  65. kapt 'frankiesardo:icepick-processor:3.2.0'
  66. //loading progress
  67. implementation 'com.wang.avi:library:2.1.3'
  68. //in app web view
  69. implementation 'com.github.delight-im:Android-AdvancedWebView:v3.0.0'
  70. //add custom font
  71. implementation 'io.github.inflationx:calligraphy3:3.1.1'
  72. implementation 'io.github.inflationx:viewpump:2.1.1'
  73. //app drawer
  74. implementation('com.mikepenz:materialdrawer:7.0.0')
  75. implementation 'com.mikepenz:fontawesome-typeface:4.7.0.1@aar'
  76. //search view
  77. implementation 'com.miguelcatalan:materialsearchview:1.4.0'
  78. //video 16:9 layout
  79. implementation 'com.ritesh:ratiolayout:1.0.0'
  80. //toast
  81. implementation 'com.github.GrenderG:Toasty:1.2.5'
  82. //bottom navigation
  83. implementation 'com.aurelhubert:ahbottomnavigation:2.3.4'
  84. //shimmer
  85. implementation 'com.github.sharish:ShimmerRecyclerView:v1.3'
  86. //mutidex
  87. implementation 'androidx.multidex:multidex:2.0.1'
  88. //kotlin
  89. implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
  90. //buttomsheet
  91. implementation 'com.github.rubensousa:bottomsheetbuilder:1.6.1'
  92. implementation 'androidx.media:media:1.6.0'
  93. implementation 'org.greenrobot:eventbus:3.3.1'
  94. //In-app update
  95. implementation 'com.google.android.play:core:1.10.3'
  96. //App oauth
  97. implementation 'net.openid:appauth:0.11.1'
  98. //debug lib
  99. debugImplementation 'com.amitshekhar.android:debug-db:1.0.1'
  100. def work_version = "1.0.1"
  101. implementation "android.arch.work:work-runtime:$work_version"
  102. // App's dependencies, including test
  103. implementation 'androidx.annotation:annotation:1.7.0'
  104. implementation 'com.google.android.gms:play-services-analytics:18.0.3'
  105. //Google billing
  106. implementation 'com.android.billingclient:billing:6.0.1'
  107. //UI Testing with Espresso
  108. androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
  109. androidTestImplementation 'androidx.test:runner:1.5.2'
  110. androidTestImplementation 'androidx.test:rules:1.5.0'
  111. implementation 'androidx.test.espresso:espresso-idling-resource:3.5.1'
  112. // include espresso-intents
  113. androidTestImplementation 'androidx.test.espresso:espresso-intents:3.5.1'
  114. }

和我的gradle.properties

  1. org.gradle.jvmargs=-Xmx2056m
  2. android.defaults.buildfeatures.buildconfig=true
  3. android.useAndroidX=true
  4. android.enableJetifier=true
  5. kapt.use.worker.api=false
  6. kapt.incremental.apt=false

依赖类路径

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

Gradle版本为8.0
Error shown

tvokkenx

tvokkenx1#

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

相关问题