So, I'm using the Processing IDE to develop an android app. I'm not publishing it to the play store, I just plan on installing it onto my phone and possibly a friend's phone if they ask for it. I expect the end result to be some file called app-debug.apk
.
I’m running Processing 4.2 on Linux Mint (Ubuntu), using Processing’s Android mode. I have tested this app by plugging my phone into my computer and using USB debugging to run the app on my phone. It works. So I'm pretty sure that faulty code isn't the culprit, but I could be wrong.
So, from Processing, I selected File → Export Android Project. This created a directory in my sketch folder called "android", which I then entered via the terminal and typed ./gradlew assembleDebug
into the terminal. Then, I got the error message
Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain
Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain
I'm not super great with gradle, so I looked this up, apparently the most likely cause for this is broken gradle files and gradle wrapper files within this directory. So I tried regenerating them by running gradle wrapper
from the same directory. And it gave me the error
FAILURE: Build failed with an exception.
* Where:
Build file '/home/chris/sketchbook/Calculator_5_App/android/app/build.gradle' line: 1
* What went wrong:
A problem occurred evaluating project ':app'.
>Failed to apply plugin \[id 'com.android.internal.version-check'\]
>Minimum supported Gradle version is 7.2. Current version is 4.4.1. If using the gradle wrapper, try editing the distributionUrl in /home/chris/sketchbook/Calculator_5_App/android/gradle/wrapper/gradle-wrapper.properties to gradle-7.2-all.zip
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6s
So, to make a long story short, this error message just means I’m expected to be using gradle version 7.2 or higher, even though I only have version 4.4.1 (at least I'm pretty sure that's what it means). However, no matter how many times I use sudo apt update or sudo apt upgrade (which are commands that tell your system to update all packages that are installed, including gradle), gradle will never upgrade to a version past 4.4.1. So...that’s unfortunate. I read online that you can try manually downloading the newest version of gradle (which is currently 8.1.1) and then do some complicated root user magickery to use that to update it, but it seems very difficult and I’m not even sure if that’d work because I’m not completely sure if it’s the gradle file that’s broken or something else.
Um, so yeah. I don’t really know what to do here. I’m not sure if it’s broken because it’s Processing for Android and that’s not as well maintained as the main java mode, or if it’s because I’m running it on Linux and the devs mainly focus on the Windows version (which is fair, I’m just glad they have a Linux version at all), or if it’s because I’m just stupid. It’s probably the last one.
Anyways, if you need any more information, please don’t hesitate to ask. Also, because I’m sure it’ll be helpful, the android folder where I’m typing these commands from contains the files:
- build.gradle
- gradle.properties
- gradlew
- gradlew.bat
- local.properties
- settings.gradle
and the folders:
- app
- wrapper
The app folder contains files build.gradle
and proguard-rules.pro
, and folders libs and src.
The wrapper folder contains the single file gradle-wrapper.properties
app/libs contains the files ComplexNumbers.jar
and processing-core.jar
app/src contains the folder main, and there’s a big long directory tree structure from there.
If you want more information on said big long directory tree structure, I can give you the output of ls -R
, which for those unfamiliar with Linux is a command which recursively shows all files, folders, and files and folders within those folders. I'd also be more than happy to provide any other information you may need. Really, any help is appreciated.
Thank you!