android 我无法建立该项目的apk文件,每当我试图建立我得到这个错误. dexBuilderBuild错误

1aaf6o9v  于 2024-01-04  发布在  Android
关注(0)|答案(1)|浏览(155)

I am getting this error while trying to build the APK file of the project.
这是我的Gradle文件

  1. apply plugin: 'com.android.application'
  2. apply plugin: 'realm-android'
  3. android {
  4. compileSdkVersion 34
  5. defaultConfig {
  6. applicationId ""
  7. minSdkVersion 21
  8. targetSdkVersion 34
  9. versionCode 1
  10. versionName "1.0.0"
  11. multiDexEnabled true
  12. testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  13. }
  14. buildTypes {
  15. release {
  16. minifyEnabled false
  17. proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  18. }
  19. }
  20. }
  21. dependencies {
  22. implementation fileTree(dir: "libs", include: ["*.jar"])
  23. implementation 'androidx.appcompat:appcompat:1.6.1'
  24. implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
  25. testImplementation 'junit:junit:4.13.2'
  26. androidTestImplementation 'androidx.test.ext:junit:1.1.5'
  27. androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
  28. implementation 'androidx.recyclerview:recyclerview:1.3.2'
  29. implementation 'androidx.cardview:cardview:1.0.0'
  30. implementation 'com.google.android.material:material:1.11.0'
  31. //okhttp logging interceptor
  32. implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0'
  33. //Retrofit Library
  34. implementation 'com.squareup.retrofit2:retrofit:2.9.0'
  35. implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
  36. implementation 'io.github.shashank02051997:FancyToast:2.0.2'
  37. //External Libraries-------------------
  38. implementation 'io.realm:android-adapters:1.4.0'
  39. implementation 'com.github.ceryle:RadioRealButton:v1.3'
  40. implementation 'com.yarolegovich:lovely-dialog:1.1.1'
  41. implementation 'de.hdodenhof:circleimageview:3.1.0'
  42. }

字符串
我尝试了堆栈溢出中的所有解决方案,但无法找到原因,有人能解释一下为什么我会出现这个错误,解决方案是什么?

hl0ma9xz

hl0ma9xz1#

通过查看随附的屏幕截图
我认为这可能是因为默认情况下(gradle.propertiesandroid.enableR8.fullMode=true使其成为android.enableR8.fullMode=false,尝试它将创建APK

相关问题