[Help] I am getting an error when trying to compile for Android testing.

I am getting “LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception: ERROR: Can’t make an APK without API ‘android-23’ minimum installed (see “android.bat list targets”)” when I try to launch to Android. I have each of the SDK, NDK, ANT, and JAVA directories linked to the correct folder. I have installed every SDK Build-tools from the installer as well as API 26 and 23 and still get this error. Not sure where the “android.bat list targets” is to check and see what the issue is. Any thoughts?

android.bat is in android-sdk-windows/tools. It lists the platforms in android-sdk-windows/platforms which are installed. Do you have the SDK API level set to ‘latest’ in Android SDK project settings? Did you install with the CodeWorks for Android 1r6u1 installer in Engine/Extras/AndroidWorks? It sets everything up as UE4 expects; if you are trying to set everything up manually or mixed with Android Studio install you may have issues if you are using newer versions.

Thanks. I used the 1r6 installer. I can try to do the 1r6u1 version tomorrow.

I looked through the android.bat file and found this error:

if exist “%swt_path%” goto SetPath
echo ERROR: SWT folder ‘%swt_path%’ does not exist.
echo Please set ANDROID_SWT to point to the folder containing swt.jar for your platform."

Any idea on how to solve this?

I was able to solve my initial problem but now I am getting the following error:

LogPlayLevel: Program.Main: ERROR: AutomationTool terminated with exception: System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
LogPlayLevel: at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
LogPlayLevel: at UnrealBuildTool.UEDeployAndroid.RunCommandLineProgramWithException(String WorkingDirectory, String Command, String Params, String OverrideDesc, Boolean bUseShellExecute)
LogPlayLevel: at UnrealBuildTool.UEDeployAndroid.UpdateProjectProperties(AndroidToolChain ToolChain, String UE4BuildPath, String ProjectName)
LogPlayLevel: at UnrealBuildTool.UEDeployAndroid.MakeApk(AndroidToolChain ToolChain, String ProjectName, String ProjectDirectory, String OutputPath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bMakeSeparateApks, Boolean bIncrementalPackage, Boolean bDisallowPackagingDataInApk, Boolean bDisallowExternalFilesDir)
LogPlayLevel: at UnrealBuildTool.UEDeployAndroid.PrepForUATPackageOrDeploy(FileReference ProjectFile, String ProjectName, DirectoryReference ProjectDirectory, String ExecutablePath, String EngineDirectory, Boolean bForDistribution, String CookFlavor, Boolean bIsDataDeploy)
LogPlayLevel: at AndroidPlatform.Deploy(ProjectParams Params, DeploymentContext SC)
LogPlayLevel: at Project.Deploy(ProjectParams Params)
LogPlayLevel: at BuildCookRun.DoBuildCookRun(ProjectParams Params)
LogPlayLevel: at BuildCookRun.ExecuteBuild()
LogPlayLevel: at AutomationTool.BuildCommand.Execute()
LogPlayLevel: at AutomationTool.Automation.Execute(List1 CommandsToExecute, Dictionary2 Commands)
LogPlayLevel: at AutomationTool.Automation.Process(String] Arguments)
LogPlayLevel: at AutomationTool.Program.MainProc(Object Param)
LogPlayLevel: at AutomationTool.InternalUtils.RunSingleInstance(Func`2 Main, Object Param)
LogPlayLevel: at AutomationTool.Program.Main()
LogPlayLevel: Program.Main: AutomationTool exiting with ExitCode=1 (Error_Unknown)
LogPlayLevel: Completed Launch On Stage: Deploy Task, Time: 7.016418
LogPlayLevel: BUILD FAILED
PackagingResults: Error: Launch failed! Unknown Error

I have visual studio 2015 installed for a compiler, have reinstalled all the SDK files, and have deleted the intermediate and saved folders in the project folder. Any other ideas on how to solve this?

This still looks like it doesn’t find android.bat. You still have something misconfigured. If you want to try it, enabling Gradle in project settings removes the need for android.bat in the build process.

I enabled Gradle and it solves the issue. Thanks.

My 1R6u1 installer in AndroidWorks doesn’t seem to have 1R6u1 as an option to be installed. I installed 1R6 and I still have the above error. Envs look good, no Android Studio, SDK API set to latest, target to 19. Any ideas?