Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create local.properties for android project in jenkins?

We have an android project for an application, it builds without any error on our local machines. Recently had to configure jenkins for the same.

Every time we run the job the BUILD FAILED. Looking for the solution to the error we got to know that the local.properties is missing in the jenkins jobs workspace of our project.

Usually this file is created locally by Android Studio. Is there any way to get this done using gradle commands or code changes? For our jenkins sdk.dir = "/var/lib/jenkins/tools/android-sdk"

Thanks

like image 595
Naman Avatar asked Dec 22 '15 03:12

Naman


1 Answers

A simple hack - Try echoing the path to a file using shell at the same job before using any gradle command as :-

echo "<path to the sdk on jenkins" >> local.properties
like image 143
Divyam Avatar answered Sep 22 '22 06:09

Divyam