Search Unity

Can't locate Android NDK in batch mode after 2017.4.16f1

Discussion in 'Android' started by ilterbilguven, Dec 10, 2018.

  1. ilterbilguven

    ilterbilguven

    Joined:
    Feb 1, 2018
    Posts:
    6
    Hi,

    After installing 2017.4.16f1 (also 2017.4.17f1), when I start building for Android with IL2CPP in batch mode, I got this error:

    Code (CSharp):
    1.  
    2. .
    3. .
    4. Cancelling DisplayDialog: Invalid NDK version Unable to detect NDK version, please pick a different folder.
    5. This should not be called in batch mode.
    6. .
    7. .
    8. .
    9. .
    10. .
    11. Cancelling DisplayDialog: Build failure! Unable to locate Android NDK.
    12. This should not be called in batch mode.
    13. .
    14. .
    15.  
    Although, I tried to set EditorPrefs.SetString("AndroidNdkRoot", PATH) explicitly and checked with EditorPrefs.GetString("AndroidNdkRoot") still gives error.

    But 2017.4.15f1 and before there is no such a problem.

    Does anyone have this issue?
     
  2. ilterbilguven

    ilterbilguven

    Joined:
    Feb 1, 2018
    Posts:
    6
    I decompiled UnityEditor.Android.Extensions.dll of 2017.4.15f1 and 2017.4.16f1. I found out AndroidNdkRoot class has been changed a lot. VerifyNdkDir method previously was returning a boolean. Now it returns VerificationResult enum. In my case, it doesn't return VerificationResult.Match, in previous version it returns true. I didn't want to look futher, so I replaced UnityEditor.Android.Extensions.dll of 2017.4.16f1 (or 2017.4.17f1) with 2017.4.15f1's. Now it's working.

    If someone has this problem, there's the workaround.
     
  3. Suduckgames

    Suduckgames

    Joined:
    Nov 28, 2016
    Posts:
    218
    Seems like from unity 2017.4.16 they have changed a lot of things. I think this is related to the new Android bundle support added in the 2017.4.17f1 so I am not sure if the workaround will work if you swtich from interal to gradle
     
  4. ilterbilguven

    ilterbilguven

    Joined:
    Feb 1, 2018
    Posts:
    6
    You are right. That workaround causes leaving newer versions' benefits. I have another workaround now. I opened Editor and build normally, It asked me NDK twice (although I gave exact the same folder I use) during build operation. Now, batch mode build seems to be working.