SDL broken in Android Studio 3.1?

I’ve just upgraded Android Studio from 3.0.1 to the latest (3.1) and my SDL projects are no longer building. I’m getting the error “cannot find class Objects”. Going by Lazy Foo’s tutorial that seems to be something to do with not using the right version of JDK.

I noticed that in gradle/wrapper/gradle-wrapper.properties the line has been updated to:

distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

whereas it used to be 4.1-all.zip (which is what Lazy Foo tells us to up it from, from the original 2.14.1 - which cures the not finding class Objects in Android Studio 3.0,1)

If I put it back to gradle-4.1-all.zip then Android Studio 3.1 tells me:

Minimum supported Gradle version is 4.4. Current version is 4.1.

I’ve been to the Oracle site and made sure I’ve got the latest “Java SE Development Kit 8u162”. I’m using all the latest SDL code too.

Help!

I’ve got things working again by changing the line in build.gradle:

classpath ‘com.android.tools.build:gradle:3.1.0’

down to:

classpath ‘com.android.tools.build:gradle:3.0.1’

When I do this Android Studio complains that I should be using the latest version and some features will be missing etc… if I don’t. I’m new to Android so I don’t know if this has any implications for SDL for the future, but at least I’m up and running again!

1 Like