[4.7.5 Mac] Packaging for Android after adding code to a blueprint project

Hi, I created a blueprint project, and successfully packaged for android.

After adding code to the project (just an empty class), packaging for Android fails (with a weird message about not BuildPlatform found for Win64 - why would it need it anyway? I’m on mac and packaging for Android…)

Am I missing something? Packaging a C++ project for Android works.

This is quite a problem to me right now since it’s completely blocking my project (many plugins require a code project in order to package correctly). Any suggestions?

MainFrameActions: Packaging (Android (ETC2)): ProjectUtils.CompileAndLoadTargetsAssembly: Compiling targets DLL: /var/folders/nf/vlnqfb_j13l6n31v9_z25nqw0000gp/T/UAT/+Users+Shared+UnrealEngine+4.7/Rules/UATRules1990125201.dll
MainFrameActions: Packaging (Android (ETC2)): BuildCommand.Execute: ERROR: BUILD FAILED
MainFrameActions: Packaging (Android (ETC2)): Program.Main: ERROR: AutomationTool terminated with exception:
MainFrameActions: Packaging (Android (ETC2)): Program.Main: ERROR: Exception in UnrealBuildTool: ERROR: GetBuildPlatform: No BuildPlatform found for Win64
MainFrameActions: Packaging (Android (ETC2)): Stacktrace:   at UnrealBuildTool.UEBuildPlatform.GetBuildPlatform (UnrealTargetPlatform InPlatform, Boolean bInAllowFailure) [0x00000] in <filename unknown>:0 
MainFrameActions: Packaging (Android (ETC2)):   at UnrealBuildTool.TargetInfo..ctor (UnrealTargetPlatform InitPlatform, UnrealTargetConfiguration InitConfiguration, Nullable`1 InitType) [0x00000] in <filename unknown>:0 
MainFrameActions: Packaging (Android (ETC2)):   at AutomationTool.ProjectUtils.CompileAndLoadTargetsAssembly (AutomationTool.ProjectProperties Properties, System.String TargetsDllFilename, Boolean DoNotCompile, System.Collections.Generic.List`1 TargetScripts) [0x00000] in <filename unknown>:0 
MainFrameActions: Packaging (Android (ETC2)):   at AutomationTool.ProjectUtils.DetectTargetsForProject (AutomationTool.ProjectProperties Properties, System.Collections.Generic.List`1 ExtraSearchPaths) [0x00000] in <filename unknown>:0 
MainFrameActions: Packaging (Android (ETC2)):   at AutomationTool.ProjectUtils.DetectProjectProperties (System.String RawProjectPath) [0x00000] in <filename unknown>:0 
MainFrameActions: Packaging (Android (ETC2)):   at AutomationToo
MainFrameActions: Packaging (Android (ETC2)): l.ProjectUtils.GetProjectProperties (System.String RawProjectPath) [0x00000] in <filename unknown>:0 
MainFrameActions: Packaging (Android (ETC2)):   at AutomationTool.ProjectParams.AutodetectSettings (Boolean bReset) [0x00000] in <filename unknown>:0

Hi devel.bmad,

Are you running source or binary of the editor? Do you mind attaching the entire output logs of the failed build to this thread as a txt file? I take it you’re using XCode to compile? If you need it, here’s the dev setup documentation for that.

Hi Wittlief, I’m running the binary version of the 4.7.5 editor on Mac (currently I cannot compile the 4.7.5 from github due to this other problem)
You can find the complete log in attach, I’ve created just a blank blueprint project, added an empty class and tried to package for android:
link text

Please note that before adding the empty class the project packages without problems.

I’m not using XCode to compile, as far as I know there is not a target for Android, I’m using File->Package Project->Android->Android (ETC2)

I didn’t notice this before, but packaging for Mac fails in the same way.

Packaging older mixed projects (e.g. created before 4.7.5) seems to work, though.

Any suggestions? Please tell me if I can help with more info.

Ok, some progress. Packaging for mac in Xcode worked. After that also packaging in UE4Editor for Android worked!

Unfortunately, back to my project, I enabled the GearVR plugin, and the same issue re-appeared. This time compiling with Xcode didn’t fix the problem, also disabling it does not help.

Progress is good :smiley: Have you ever been able to package for the GearVR? Do you mind attaching a fresh output log? It may be a problem with your SDK setup. For reference, here’s the brand spanking new GearVR documentation.

Yes, I can package for GearVR if starting from a code only project.

What I need to achieve is adding code to my blueprint project (needed to compile plugins like the GearVR one) and then package for Android.

In any case, it now fails both with the plugin enabled and with the plugin disabled. In attach you can find both logs from the project failing:

link text
link text

The initial empty projects (Test2) now packages also with the plugin… I’m puzzled :-/

I don’t think these could be the cause, I had similar issues with empty projects based on the default templates.
A workaround I found at the moment is creating a new code project and the migrate all the contents and the level from my previous project. This works, but, of course, this is far by being optimal…

Hi devel,bmad,

You mentioned you had similar issues with empty projects. Were these projects also BP with code added?

Yes, as I mentioned, my objective was to add code to a BP project in order to compile plugins. After adding an empty class to a BP project I cannot package anymore for android, because of the messages above.

Hi devel.bmad,

After struggling with some unrelated build issues of my own, I was finally able to attempt a repro for your issue. I made a blank BP project, added an empty C++ class, compile was successful and then packaging for development and ETC1 was successful. I did not attempt the addition of the VR plugin yet, since you mentioned it was failing even before that step, now. Are you still seeing the failure?

Hi tested again in 4.7.6 and I have the same issue (VR plugin disabled). I’m on mac, on which platform did you test the issue?

Please note that:

  • After adding code I cannot package neither for mac nor for android
  • In Xcode I can package for mac (but there’s not way to package for android AFAIK)

A workaround I’ve found is creating a new code project and then migrate the whole contents from my previous BP project here to package (but, as you can imagine, this is far from practical in many cases)

You’re correct in pointing out that you’re using a Mac; I only tested on Windows. I will reach out to another support tech who is more familiar with Xcode and see if we can reproduce on the Mac.

There is a bug in the CompileAndLoadTargetAssembly in UAT. It always attempts to create a dummy TargetInfo using Win64 as the target platform. I’ll change that to check the host platform and utilize that, but in the mean time, if you have source, in ProjectUtils.cs at around line 486 (may be different line in 4.7.5) there is new TargetInfo(UnrealTargetPlatform.Win64 change that to UnrealTargetPlatform.Mac and you should be ok to build until I get the fix in.

-Pete

Thanks I’ll try this, very helpful.

I’m also testing 4.8P1 right now, Android code projects do not package for a new different reason there, don’t know if this is somehow related: