I would like test our android applications via Jenkins. I configured everything, but i got this error message:
[android] Emulator did not appear to start; giving up
I found a solution for this problem from here
This one can have several reasons. One of them is listed in the error below. I didn't encounter this myself but I've read on stackoverflow while looking for a solution to my specific issue. It seems to be related to the revision of the android sdk tools. On windows there was a fix like stated in this ticket: https://issues.jenkins-ci.org/browse/JENKINS-10815 However there seems to be a similar issue on linux that isn't fixed yet (at least the ticket is still open): https://issues.jenkins-ci.org/browse/JENKINS-14901
Solution: The proposed solution in that ticket is to create a link with the name emulator (back original) towards the appropriate emulator-X bin.
I tried it and solved our problem, but only some builds, after that I got again this message. That's why i removed the android plugin and deleted the sdk folder, so i reinstall everything. After that there were 4 success builds. (Interesting, that i didn't create emulator link like than before) But it was all, the problem backed. I played with configuration and set 30 second delay for emulator start and checked the "delete emulator after build" option. I thought that the problem solved because I had 14!!! success build but the problem backed again :( And now there is a new error message too:
NAND: could not write file /tmp/android-jenkins/emulator-CaWkYU, File exists [android] Emulator did not appear to start; giving up
What are you thinking, what is the problem? With same setting sometimes success, sometimes not. Why?
What is Jenkins? Jenkins is a tool that is used for automation, and it is an open-source server that allows all the developers to build, test and deploy software. It works or runs on java as it is written in java.
This CI server runs in servlet containers such as Apache Tomcat. Jenkins facilitates continuous integration and continuous delivery in software projects by automating parts related to build, test, and deployment. This makes it easy for developers to continuously work on the betterment of the product by integrating changes to the project.
Continue reading to learn more about Jenkins and why it's one of the leading DevOps tools today. Jenkins is an automation server written in Java that helps build, test, and continually deploy software. The open-source system is currently one of the leading automation servers. Various version control tools such as Git.
With over 200,000 installations to date, Jenkins remains the most widely used open-source automation server. And story after story, we hear what a critical role Jenkins plays in building robust, secure CI/CD pipelines. So it comes as no surprise that in many of...
Finally i found the problem in the source code: AndroidEmulator.java
The adb connection timeout is 1min and it's fix:
private static final int ADB_CONNECT_TIMEOUT_MS = 60 * 1000;
So i increment it to 5 mins, build a new plugin and installed and it solved my problem (~100 build without this problem)
How many build executors do you have (default is 2)? I bet you can only have one emulator running on your Jenkins server at a time, when two jobs are trying to execute, one job is getting clobbered. If this is the case, you may want to consider the Heavy Build plugin to lock up all executors when an Android job goes by. Or use slaves.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With