Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

using jenkins auto build android ,but Android SDK Location is missing.

Discussion in 'Editor & General Support' started by xuanyusong, Jul 28, 2015.

  1. xuanyusong

    xuanyusong

    Joined:
    Apr 10, 2013
    Posts:
    49
    hi all. when I was update to unity5.1 has this problem.

    Unity -> Preferences -> Android SDK Location . set android SDK

    I am using jenkins to call unity auto build android apk . but Android SDK Location is missing. I need set android path again.
     
  2. xuanyusong

    xuanyusong

    Joined:
    Apr 10, 2013
    Posts:
    49
    Preferences -> External Tools -> Android SDK Location

    How can script set it path?
     
  3. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
  4. xuanyusong

    xuanyusong

    Joined:
    Apr 10, 2013
    Posts:
    49

    thank you ~ My Jenkins run is OK~~ but I think It 's a bug for unity5
    this is my code~

    Code (CSharp):
    1.         EditorPrefs.SetString("AndroidSdkRoot","/Volumes/Mac-Tools/android-sdk-macosx");
    2.         if (string.IsNullOrEmpty (BuildPipeline.BuildPlayer (GetBuildScenes (), args [0], BuildTarget.Android, BuildOptions.AcceptExternalModificationsToPlayer))) {
    3.             myencryptDll (args [0]);
    4.         }
     
  5. shan_lin

    shan_lin

    Joined:
    Apr 20, 2015
    Posts:
    4
    I find reason:
    In the Unity, call EditorPrefs.SetString("AndroidSdkRoot",value) change regedit
    HKEY_CURRNET_USER/Software/Unity Technologies/[UnityEDITOR 4.x]/ AndroidSdkRoot_h2651068356

    In the Jenkins, call Unity3D Plugin run Unity.exe set EditorPrefs.SetString("AndroidSdkRoot",value)change regedit
    HKEYS_USER/.DEFAULT/Software/Unity Technologies/[UnityEDITOR 4.x]/ AndroidSdkRoot_h2651068356

    So, Unity Run and Jenkins Run , regedit path is different

    I thinks Jenkins is third party, so is HKEY_USERS