Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AGPBI: {"kind":"error","text":"com.android.tools.r8.kotlin.H","sources":[{}],"tool":"D8"}

With the update of Android Studio Hedgehog | 2023.1.1 | Patch 2, Kotlin 1.7.0, and Gradle being set yet as 7.4, we have this error with not so much info on how to resolve it.

Has anyone else experienced this exact error or have ideas where to look?

it also gives Caused by: [CIRCULAR REFERENCE: com.android.tools.r8.kotlin.H] error message at the end of the build output, but we have no circular dependencies within our app modules.

like image 338
Oleksandr Nos Avatar asked Sep 11 '25 17:09

Oleksandr Nos


2 Answers

Changing minimumSDK from 22 to 26 in project level build.gradle, solved my issue.

defaultConfig {
    minSdk 26
    targetSdk 33       
}
like image 137
Pavlos Mavris Avatar answered Sep 14 '25 08:09

Pavlos Mavris


Also had same issue when migrating project to Android 14 i.e sdk 33 to 34. Was able to run app, create release variant apk but getting this exception when creating debug variant apk. Added this to project level gradle & finally no issues.

buildscript {
    repositories {
        maven {
            url = uri("https://storage.googleapis.com/r8-releases/raw")
        }
    }
    dependencies {
        classpath("com.android.tools:r8:8.3.37")
    }
}

Using following config:

  • gradle-7.5.1
  • compileSdk & targetSdk 34
  • minSdk 21
  • kotlin 1.8.20
  • androidGradlePlugin 7.4.0
  • Android Studio Koala

Probably issue is in r8 version, so forcing this latest version resolved our problem.

like image 22
Daniyal Javaid Avatar answered Sep 14 '25 07:09

Daniyal Javaid