Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio generated files in java folder after upgrading to AGP 8 + Gradle 8.0 + Kotlin 1.8.20

The problem is exactly as said in the title. Android Studio is putting Hilt and Glide generated files in regular java folder instead of java(generated) leading to a lot of generated files and packages next to source files.

Problem occurs only on 1.8 Kotlin version. Everything prior to this version works fine. I believe that the root of the problem is kapt, using annotationProcessor leads to the expected result

like image 804
Ilya Zagarovsky Avatar asked Oct 14 '25 09:10

Ilya Zagarovsky


1 Answers

Go to the Android Studio Settings and open this path like so:

Build, Execution, Deployment > Build Tools > Gradle

enter image description here

Change the Gradle JDK to the 11 version if it is 17 and press OK. Roll back any changes in files that define the JDK version like misc.xml.

Clean your project using Build menu in the toolbar and Clean Project item and rebuild your project. It is also a good idea to Invalidate Caches and restart before build.

like image 125
Squti Avatar answered Oct 17 '25 02:10

Squti



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!