philburk / android-midisuite

Android MIDI test programs and examples.
Apache License 2.0
153 stars 53 forks source link

Error when building project in android studio with gradle 8.0.2 #76

Open batata004 opened 1 year ago

batata004 commented 1 year ago

Hi, I have the latest Android Studio on my Win11 computer. I tried opening your MIDISCOPE project in it, and it shows this error:

BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 61

I didnt change anything, I just tried opening it on Android Studio. Any suggestion how can I fix it?

JayMad18 commented 1 year ago

Take a look at this link: https://stackoverflow.com/questions/68597899/bug-exception-in-phase-semantic-analysis-in-source-unit-buildscript-unsup

-let me know if it helps or not.

philburk commented 1 year ago

I am also stuck. I was getting the same error with:

BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 61

I upgraded to Android Studio Flamingo. I tried updating gradle. Switching to use JDK jbr-17. I am seeing lots of reports of problems on stack-overflow.

I even created a new Project and tried to build it and it would not build. Getting:

A problem occurred configuring root project 'TryToBuild'.
> Could not resolve all files for configuration ':classpath'.
   > Could not resolve com.android.tools.build:gradle:8.0.2.
     Required by:
         project : > com.android.application:com.android.application.gradle.plugin:8.0.2
         project : > com.android.library:com.android.library.gradle.plugin:8.0.2

Full error log in:

android_studio_build_errors_1.txt

philburk commented 1 year ago

I have not been able to get gradle 8.02 to work. I just get these cryptic error messages that I cannot solve.

I am now using gradle 7.5, which seems to work fine.

Also you should make sure you have PR #78, which updates the targetSDK and permissions to work with Android S and above.