How to setup Visual Studio 2015 for UE4 4.11 Development Android Build Configuration

I migrated my 4.10 project to 4.11, but now I can’t build my solution for the Development Android configuration. I’m using Visual Studio 2015, but it seems like the generated Visual Studio files are targeted for Visual Studio 2013. After I retarget the solution, I can build for Win64, but I can’t build for Android. I get an error that the build tools for v140 cannot be found. But I’m sure the v140 Platform Toolset is already installed (it should come with Visual Studio 2015). How am I able to build for Win64 but not Android without the proper build tools? Am I forgetting to install something?

Comparing 4.11 to 4.10, it seems like the Android build configuration for 4.11 has a new platform defined as “Tegra-Android”. In 4.10, the platform used for the Android build configuration was just Win32. Why is there this change? Do I really need to build for Android if developing for that platform? It seems to launch fine to my device even when building for Win64.

After going through the UE4 documentation on setting up Visual Studio again, I’ve noticed that I might not be doing some things correct for Android development, but the documentation isn’t too clear about it either.

  1. Am I supposed to only use Visual Studio 2013 for Android Development, or does VS2015 work as well?

  2. If I’m only supposed to use VS2013, how can I set UE4 to open source files with VS2013? It keeps reverting to VS2015 (I have both installed on my system).

  3. Can I generate project files by right clicking on the uproject file and selecting “Generate Visual Studio Project Files” or am I supposed to run RocketGenerateProjectFiles.bat located in the UE4 Engine folder? Apparently, I can specify the target platform and Visual Studio version when using this batch file, but for some reason I get an error message “Couldn’t find target rules for target” when using the solution file generated by this batch file.

  4. Can I use the compile button in the UE4 editor? Or should I always build from VS?

Hey -

Android development and packaging requires the VS2015 compiler. If you have Android SDKs installed, running the Generate Visual Studio project files from the .uproject’s right click menu should generate a 2013 project by default. And to answer you last question, you can use either the in editor compile button or compile from Visual Studio. Using the editor button or compiling from VS with the editor open will preform a hot reload of any changed code. Compiling from VS with the editor closed preforms a regular compile that will clean up hot reload dll’s. If you preform a hot reloads regularly it is a good idea to do a regular compile every so often to clear out old hot reload dll’s.

Cheers

Hi ,
Thanks for your reply! Did you mean to say that Android development and packaging requires the VS2013 compiler instead? Because it wouldn’t make sense that VS2013 projects are generated by default if Android SDKs are installed, but then VS2015 is needed. If so, should I uninstall VS2015, since UE4 keeps on opening VS2015 when I click on a source file in the editor, even when I set source files to open with VS2013 by default.

Yes, I apologize. I did mean to say VS2013 (not 2015). If you are not developing for Android, removing the SDKs and then generating project files for your UE project should give you a 2015 solution instead of a 2013 solution.

Is it possible to manually specify which solution version to generate? I’m working simultaneously on a project for android and a project for desktop. Removing the Android SDKs just to generate VS2015 files is pretty inconvenient. Also, is there a setting to specify which version of VS to use when opening source files in the editor? It seems like UE4 just uses VS2015 by default, even when the solution file is for VS2013 (and the default application in Windows for opening source files is VS2013). Right now, I have to manually open the solution in Windows Explorer, rather than in the UE4 editor. Thanks!

Hey -

Unfortunately there is not a way to specify which version of Visual Studio is used per project. Projects that use the 4.9 or earlier engine will default to use VS2013 and projects using the 4.10 or later engine will default to VS2015 (expect in the case of Android / SDKs present). I have entered a feature request (UE-29249) to allow selecting which version of VS is used per project.

Hey and , i have some questions for you related to this issue.

I have a large scene/project in Unreal (nearly 6-7 gb smthng like that) and packaging in Unreal Editor takes way too long, especially for Android.

I am also installed “Incredibuild” - compiling software that integrates within VS, works within VS as a part of it - it makes your build way too faster than Unreal Editor build. But in order to use it, I need to build my project from Visual Studio.

So I open project in Unreal Editor first, then i click “Cook Content for Windows” (because if i don’t click this, it gives you this error (when developing for windows in VS):

96633-ekran+alıntısı.png

So after i click cook content for windows and open VS, I am choosing development and Android section in Solution Config. and Solution Platforms. After that i click “Build Solutions” in Build.

96634-ekran+alıntısı+vs.png

Finally after a successful build , it creates 3 files in Unreal Projects - “Your Projects” - Binaries - Android like this:

96635-ekran+alıntısı+android+build.png

I know it’s been a long question but how can i run these 3 files in my Android device ? Running and installing apk file file doesn’t work, i guess it’s something to do with those two .so and .target files ? Do i need to place them somewhere specific in my Android phone like placing .obb file in OBB folder ? or it requires some more tools , am i missing something ???

I deployed and run Android projects with my phone before, using Unreal Editor / File Tab / Package Project / Android / Android (ATC) , it creates a bat file in a folder that you chose and when you click it installs project to your device.

But I haven’t been able to do this via Visual Studio way. I will be grateful for any help.

I haven’t tried packaging for android through VS, but I’d recommend just launching to your android device through the UE4 editor instead of packaging if you want fast iteration times. Subsequent launches require very little cooking/building since the intermediate data is saved. If you need to package frequently, then you might want to uncheck “full rebuild” under the packaging project settings.

Yes direct launches to Android device within UE4 editor is more faster, but the project that i am trying to build for Android is too big and my phone does not have very much space. Packaging creates a file that include a bat installer but regardless of size, when i connect my phone and install that .bat file, it installs the project on my device with a “specific” size, 148 - 150 mb. I don’t know why they always compress to this size , maybe android has a default size for this regardless of how big is the file.

But i don’t know just launching to device will use such sizes.

And the other thing is processing time still too long. Also just launching still takes +1 hour so that’s why im using VS with Incredibuild.

Finwefeanor,

Launching onto your device will only install the current map on the device for fast iteration, and switching between levels is unsupported with launching. If you want to have all of your maps, data, etc installed on your device at once, you’ll need to package your game.

Please keep in mind that the larger your project is, the longer it’ll take to package. This also depends on your computer specifications, as a “slower” computer can and will slow your build down.

[Launching Documentation][1] | [Packaging Documentation][2] | [Reducing APK Packaging Size][3] | [Unreal Frontend][4]

Have you tried deleting your: Intermediate and Saved folders from the project? What about renaming your project? Here is [an AnswerHub post][5] that had a similar issue.

Looking forward to hearing back from you, thanks!

Launching Unreal Engine Projects on Devices | Unreal Engine 5.1 Documentation
[2]: Packaging Unreal Engine Projects | Unreal Engine 5.1 Documentation
[3]: Optimization Guides for Android in Unreal Engine | Unreal Engine 5.1 Documentation
[4]: Using the Unreal Frontend Tool | Unreal Engine 5.1 Documentation
[5]: Global shader cache-pcd3d-sm5 missing - Platform & Builds - Epic Developer Community Forums

Hi ,

Thanks for the answer. Like i said above, the project that i’m trying to package takes hours via UE4 editor, because its too big. There are lots of actors, assets on the project, deleting intermediate/saved folders reduces the size but packaging still takes too long.

That’s why I’m using Visual Studio. “Incredibuild” is also used by Unreal/Epic Staff if i’m not wrong. it makes building time much shorter but it can only be used within Visual Studio, building takes less than 15-20 mins. So i need to package/build using VS build.
What i don’t know is how can i run these outputs into my android device

96635-ekran+alıntısı+android+build.png

because i don’t know what the .so file is and what to do with it , where to place it in my phone, because just installing .apk doesn’t open the project. I believe that I’m doing something very wrong here (Same projects opens when i package the project within UE4 editor/Package Projects/Android ATC. with this way it takes very long but it opens on the device at the end. Visual Studio way is much much shorter like i said)

I’ve most of the documents that you posted but i didn’t know about “Unreal Frontend”. Maybe this whole thing explained there, i will write a post again when i look at it detaily. thanks.

We’re a bit confused on the process you’re using here. Could you please provide exact repro steps that you’re taking to get the files in the image above?

Please keep in mind that depending on the size of the project, even with Incredibuild, it’ll still take a while to package.

Thanks!

This may be a bit off topic from what your looking for, but there’s a plugin called Mobile Remote Control that was recently released on the marketplace. It sends touch and motion input from your mobile device to the editor via usb or wifi, while sending the game graphics from the back to your mobile device. You can basically play your game on your phone by just hitting the play button in the editor. I purchased it today and tried it out. The latency and quality is pretty good. I’d definitely recommend it for mobile development since it significantly cuts down on build/cook times. It’s available at this link for $15:

You can only install it through the launcher, so if you want to install it to your own compiled engine, you’ll have to first install it to an official released version. Copy the files in the plugins folder (Engine/Plugins/Marketplace/RemoteControl) over to your engine’s plugins folder. When you launch your compiled engine, it’ll ask you to rebuild the dll for the plugin. Click OK and you should be good to go!

this is what i do for that output:

  1. Just create a simple blueprint TPS example project with no starter content (or a Blank Project also will do )

  2. And within UE4 editor go File>New c++ class>None>Create Class to add c++ code to project. ( I’m just doing this to be able to open VS, Because when you right click your project in your project folder and try to select “Generate Visual Studio Project Files” It says this project does not have any source code etc. When you do this VS opens)

  3. When it opens VS and finishes parsing files, select “Development” from Solution Config. and “Android” from Solution Platforms. and then go for Build>Build Solution.

  4. It will create those 3 files in your Documents/Unreal Projects/“Your Project”/Binaries/Android

This is where I’m stuck. If I choose Win64 as Solution Platform it runs, but Android Build doesn’t. Maybe there is a different way to install that files in android device but i don’t know.

97565-ekran+alıntısı+tps.png

If you go to the location of the .apk file, plug in your device and press and hold shift while pressing the left mouse button, it’ll open a menu. From that menu, select to open the Command Window. Once it loads type ‘Install’ and hit tab. It should autofill. Next all you would need to do is press enter and it’ll install.

Have you done that previously?

hi, I also like to know how to solve it . I am using UE4 4.12.5 ,exactly the same result . apk is small an contain no data, after use “adb install” the app, the app quit at start, seems the app can’t find data. can I generate 1 apk with all the data?

Please create your own AnswerHub thread for additional assistance. Include detailed information, editor output logs and the following logs from your mobile device.

I’m also going to need for you to provide me the logs from your mobile device, if you’re actually getting the project onto your phone.

  • Attach your phone to the computer
  • Go here: C:\android-sdk-windows\tools
  • Open up Monitor.bat
  • Launch the program and save the logs

Make sure that you highlight all of the logs, because they do not save unless they’re highlighted.