Search code examples
androidjenkinsgradlekotlinapk

kotlin.KotlinNullPointerException (no error message) while building APK using Jenkins


I am new to Jenkins and trying to generate APK.I am getting the following error: enter image description here

I have added git credentials and gradle script is as below: enter image description here

Note: I have a build Type named "Dev"


Solution

  • I had this problem while configuring my jenkins for an android project, and finally found the problem, after even formatting my pc.

    The gradle just cannot find where the Android SDK is located. Adding this to .zshrc (or .bashrc, whatever shell you are using) resolved my problem:

    export ANDROID_HOME=/Users/<your-user-here>/Library/Android/sdk

    Don't forget to verify if the specified folder above contains the folder sdk.

    Edit: I did this in a macOS environment, you should look for the correct sdk location in your OS.