I’m at a complete loss here, I’m trying to setup Android Development and have tried 4 different methods even followed the Unreal Engine guide but every time I run the SetupAndroid.bat to install the NDK I get this error
C:\Program Files\Epic Games\UE_4.26\Engine\Extras\Android>SetupAndroid.bat
Android Studio Path: C:\Program Files\Android\Android Studio
Android Studio SDK Path: C:\Users\depre\AppData\Local\Android\Sdk
\Microsoft was unexpected at this time.
If anyone could shed some light onto what’s going on I would appreciate it.
I didn’t figure this out but I got it working without it anyway.
This happens because you have bracket symbols in user paths and whoever wrote this batch script didn’t thought of that.
Can be fixed by editing
SetupAndroid.bat and wrapping
%USERPATH% in quotes on line 56:
echo Current user path: "%USERPATH%"
Second problem you may encounter is SetupAndroid.bat unable to locate sdkmanager.bat even if it actually exists in
In this case you need to add this line at the beginning (next line after after
! on lines 67 and 68:
IF EXIST "!SDKMANAGER!" (
echo Using sdkmanager: !SDKMANAGER!
Thanks, I was running this on Windows 11 at the time. I’m not sure if it still has the same issue but I re-installed Windows 10 and it worked just fine. Thanks again for the response, If I come across this issue again I’ll be sure to give this a shot.
these are already set up like this in the .bat I have, why else might this be the issue
Thank you so much. I wouldn’t have figured this out without you!
did you ever figure this out? I just ran into the same issue
Wrapping %USERPATH" in quotes on line 56 fixed the issue for me, thanks a bunch @grinchfox