Mindmax
Mindmax

Reputation: 89

Android Java Build errors

I tried to build my project today, because everything worked fine in Android Studio Intellij on my phone. But now there are two things. the first thing is that the build say:

Could not open init remapped class cache for 9bbaqp2sgtpoz1dwcumqbqtxg (C:\Users\Max\.gradle\caches\5.4.1\scripts-remapped\ijresolvers_3l0ejc2wfly7v3w1ngwtcqg40\9bbaqp2sgtpoz1dwcumqbqtxg\initdcd040730888da95d185715568c9cc57).
> Could not open init generic class cache for initialization script 'C:\Users\Max\AppData\Local\Temp\ijresolvers.gradle' (C:\Users\Max\.gradle\caches\5.4.1\scripts\9bbaqp2sgtpoz1dwcumqbqtxg\init\initdcd040730888da95d185715568c9cc57).
   > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 57

And the other thing is that in the src/androidTest/java/application/ExampleInstumentedTest is an error with the import:

import androidx.test.ext.junit.runners.AndroidJUnit4;

After I searched a while I still have no clue what to do please help!

Upvotes: 0

Views: 165

Answers (2)

ico2k2
ico2k2

Reputation: 61

At the end of the error stack trace you posted appears Unsupported class file major version 57, which suggests you should try an earlier version of JDK. If I am not wrong, you have JDK 13. Try version 11 or even version 8.

Upvotes: 0

frokenfreyja
frokenfreyja

Reputation: 17

Have you tried to clear Android Studio's cache and bring it out of its state of confusion? If not, select 'File > Invalidate Caches / Restart' and then click the 'Invalidate and Restart' button. Clean and rebuild your project.

Upvotes: 1

Related Questions