Android won't Build - General error during semantic analysis...
batroost opened this issue · 4 comments
Hi,
I've done a fresh install of Processing 4 - 4.0b8 - installed Android Studio, checked/synched gradle versions, and tried different Java versions multiple times. But every time I try to build even a very simple Android Mode project I get the following errors:
* What went wrong:
Could not compile build file 'C:\Users\Colin\AppData\Local\Temp\android13736299304255339646sketch\build.gradle'.
> startup failed:
General error during semantic analysis: Unsupported class file major version 61
java.lang.IllegalArgumentException: Unsupported class file major version 61
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:196)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:177)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:163)
at groovyjarjarasm.asm.ClassReader.<init>(ClassReader.java:284)
at org.codehaus.groovy.ast.decompiled.AsmDecompiler.parseClass(AsmDecompiler.java:81)
at org.codehaus.groovy.control.ClassNodeResolver.findDecompiled(ClassNodeResolver.java:251)
at org.codehaus.groovy.control.ClassNodeResolver.tryAsLoaderClassOrScript(ClassNodeResolver.java:189)
at org.codehaus.groovy.control.ClassNodeResolver.findClassNode(ClassNodeResolver.java:169)
.....
With another 100 lines or so of errors beyond that.
I guess its the first bit that's important, but I'm not an expert in this area and I can't find what I need to change to fix it. Java mode builds work just fine, even for my most complex (10,00 lines of code) project, but I'd like to be able to produce my android apps as well.
I'd appreciate any ideas anyone might have? Or is this a spec. for set-up that I missed?
Many thanks,
Batroost
Running Windows 11, have tried Java 16, 17, 18, gradle versions back to 6.8.3, including 7.10, and 7.4.2 (I think).
@batroost this error happens when you try to run a sketch from the PDE in the Android mode, correct? Or are you running your code from Android Studio? I'm not entirely sure based on the description of the issue.
Android Mode in Processing4, yes.
I may have found the answer... My P4 sketchbook and P4 program were on different drives. This morning I removed P4, set up a new sketchbook and a fresh copy of the P4 program in the same eplace on the same drive. This seems to have solved the problem; either that or it's something else I did yesterday whilst trying to export from P3.
@codeanticode The time Android Mode(older version) uses Gradle version of the lower level, it saves the older Gradle version in preferences.txt file. Later on, using Android Mode(New updated) it uses Java 17 but uses that lower version of Gradle from the preferences.txt file. In that case, the older Gradle version would be used and would not support java 17 used by PDE and can throw an error like this.
Removing/Resetting preferences.txt probably resolves the issue.