Help using docker ephemeral slave agent for android

hello.
i’m doing some experiments with jenkins and I’d like the idea of using dynamic slave agents for our android project. Does someone know if there is a docker image already available for that? I was following this tutorial but I got this error:

Starting agent process: cd “/home/jenkins” && java -jar remoting.jar -workDir /home/jenkins -jar-cache /home/jenkins/remoting/jarCache
Error: A JNI error has occurred, please check your installation and try again

Exception in thread “main” java.lang.UnsupportedClassVersionError: hudson/remoting/Launcher has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I think this is related to the jvm used in the docker image of the tutorial.

Cheers
Gianpaolo

Hello and welcome to this community @gianpaolof :wave:

You have to use the same version of Java on the agent and on the controller.
Could you please check if that’s the case?
Bytecode version 52.0 is JDK8, and 55.0 is JDK11.
Please note that JDK8 is not supported anymore since Jenkins 2.357 and 2.361.1 LTS.
If you need more recent Android Docker images, I have created quite a lot of them there: Docker Hub

1 Like

thanks, that was the case!
since I’m here, did you also create images for ios slave?

1 Like

Thanks a lot for your feedback.

I will work on iOS builds with Jenkins in the coming months, but I’m not sure I will be able to produce a Docker image.
I have several ideas in mind, one of them being using docker-osx.

1 Like

welcome.

I see. From my first googling on github & c, having a slave docker for ios must be complicated. Thanks a lot for your reply :slight_smile:

1 Like

You’re welcome too. :hugs:

It’s more complicated than with Android, for sure, but it must be doable.
Did you see the AWS blog post about iOS builds on Jenkins?

Do you have an Apple machine on your own, or do you only use Linux?

1 Like

So far we have used a mac mini with fastlane to build both ios and android.
Then, since we have our own cloud, I created an Ubuntu VM and started experimenting with Jenkins controller left on the mac mini and the slave on the ubuntu.
One thing not clear: I thought apple hardware was mandatory tobuild ios, is that true?

Did not see thatblog post, thanks

1 Like

As far as I know, it’s legally mandatory to have Apple hardware to build iOS/macOS apps.
Technically speaking, not, it’s not mandatory.

1 Like

Ah! That’s interesting. I’m not a ios dev so I never dig into it, I thought that building and signing ipa were all depending on real mac h/w. U never stop learning :smiley: