Gradle/Java issues building for Android

I’m trying to test a project on an Android device. It seems to build everything correctly, but then chokes on Link: libApplicationMain-v7.so.

The problem seems to be the gradle version. I’ve tried setting the android gradle-version in project.xml to several different versions, all of them failing in one way or another. Versions and errors are as follows:

Gradle 2.10 (default) and 3.5.1:

Could not determine java version from ‘15.0.1’.

(This seems to be an error with newer versions of Java changing their version name convention.)

Gradle 4.10.3

A problem occurred evaluating project ‘:app’.
Failed to apply plugin [id ‘com.android.application’]
Gradle version 2.10 is required. Current version is 4.10.3. If using the gradle wrapper, try editing the distributionUrl in /Users/patrick/.gradle/daemon/4.10.3/gradle/wrapper/gradle-wrapper.properties to gradle-2.10-all.zip

(Is 2.10 required?)

Gradle 5.6.3:

Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

Gradle 6.9.2

A problem occurred evaluating root project ‘bin’.
Cannot add task ‘wrapper’ as a task with that name already exists.

Gradle 7.3.3:

“A problem occurred configuring root project ‘bin’.”
Could not resolve all dependencies for configuration ‘:classpath’.
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository ‘BintrayJCenter(http://jcenter.bintray.com/)’ to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.3.3/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details.

I’m running Java 15.0.1 and lime 7.2.1. For the Android NDK I’m using r21e. I cannot upgrade lime on this project for various reasons. I could downgrade Java but I’m reluctant to if there’s a better solution. Is there some version of gradle (or combination w/ Java) that is working for people?

---- UPDATE -----

I switched to Gradle 2.10 + JDK 1.8 + Android SDK 26 and got further. Now the compilation halts at:

/MyDir/Export/android/bin/app/src/main/java/org/libsdl/app/HIDDeviceManager.java:109: error: cannot find symbol
            SDL.loadLibrary("hidapi");
               ^
  symbol:   method loadLibrary(String)
  location: class SDL
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:app:compileDebugJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'. 

Any thoughts on what’s going wrong here?

---- UPDATE 2 -----

So, I rebuilt the project from scratch, and now—for reasons that are unclear to me, as my project.xml is identical—it seems to be working correctly, although it gives the complaint: “This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.10/userguide/gradle_daemon.html”.

Weird. But at least it compiles and deploys.