Jenkins unity3d plugin: Unable to locate Android SDK

Trabla: Jenkins unity3d plugin: Unable to locate Android SDK


Jenkins unity3d plugin Unable to locate Android SDK tutorial

But Android SDK path defined in Unity3D editor:

Jenkins unity3d plugin Unable to locate Android SDK tutorial 1


What is the problem ?!

Jenkins unity3d plugin Unable to locate Android SDK tutorial 2

Jenkins unity3d plugin Unable to locate Android SDK tutorial 3

Jenkins Logs:

Unloading 0 unused Assets to reduce memory usage. Loaded Objects now: 1674.
Total: 5.696053 ms (FindLiveObjects: 0.245088 ms CreateObjectMapping: 0.041703 ms MarkObjects: 5.396430 ms  DeleteObjects: 0.010907 ms)


*** Cancelled 'Build.Player.AndroidPlayer' in 3 seconds (3087 ms)

Exception: BuildPlayer failure: Error building Player: UnityException: Build failure!
Unable to locate Android SDK
  at MyBuildScript.GenericBuild (System.String[] scenes, System.String target_dir, BuildTarget build_target, BuildOptions build_options) [0x0001d] in C:\Users\samuraikit\Unity-Projects\demo-buildScript\Assets\Editor\MyBuildScript.cs:46 
  at MyBuildScript.PerformAndroidBuild () [0x00010] in C:\Users\samuraikit\Unity-Projects\demo-buildScript\Assets\Editor\MyBuildScript.cs:26 
 
(Filename: Assets/Editor/MyBuildScript.cs Line: 46)

executeMethod method MyBuildScript.PerformAndroidBuild threw exception.
 
(Filename: C:/buildslave/unity/build/Runtime/Utilities/Argv.cpp Line: 168)


Aborting batchmode due to failure:
executeMethod method MyBuildScript.PerformAndroidBuild threw exception.

FATAL: Unity3d command line execution failed with status 1
Build step 'Invoke Unity3d Editor' marked build as failure
Finished: FAILURE



Environment:
OS: Windows.
Unity3D 5.3.3f1


Solving:


1. Create windows Environment variable

- name "ANDROID_SDK_ROOT"

- value - path to sdk ( same as in Unity3d editor )
e.g. C:/Users/samuraikit/AppData/Local/Android/sdk

Jenkins unity3d plugin Unable to locate Android SDK tutorial 4

2. Restart Jenkins !!!

Jenkins unity3d plugin Unable to locate Android SDK tutorial 5

No comments:

Post a Comment