I have developed 2 apps for personal use. I do this as a hobby and find the interaction between Android Studio, Java and Gradle very confusing.
When I opened Android Studio for the first time in months to make a minor modification to one app I followed a prompt to upgrade Android Studio to Iguana 2023.2.1 . After doing that the Gradle build for one of the apps failed. In attempting to resolve this I followed a suggestion to use “AGP Upgrade Assistant” to upgrade from 4.0.1 to 4.2.2. The Gradle build now fails with following messages:
Could not open init generic class cache for initialization script
‘C:UsersprepbAppDataLocalTempijWrapper1.gradle’
(C:Usersprepb.gradlecaches6.7.1scriptspyh0v03oa5pxvesmcpjvakm7).BUG! exception in phase ‘semantic analysis’ in source unit ‘BuildScript‘ Unsupported class file major version 61
- Try: Run with –stacktrace option to get the stack trace. Run with –info or –debug option to get more log output. Run with –scan to get full insights.
I’ve seen this thread BUG! Exception in phase ‘semantic analysis’ in source unit ‘_BuildScript_’ Unsupported class file major version where the poster was advised to check that Java and Gradle versions are compatible.
The accepted solution includes a screenshot for a window where the “Gradle JDK” can be found at Preferences → Build,Execution,Deployment → Build Tools → Gradle. I can’t find Preferences in the menus. Where can I fond this information in Android Studio Iguana | 2023.2.1 Patch 2?