Can Compile in UE4 But Cannot Compile in XCode 7

Hi,

I am trying to use UE4 to compile my game in android phone. I have been successful to make it run in android. All of that is done in the UE4 Editor.

But when I tried to compile it in XCode (klik the Play button), it says the build is failed.

The log is as follows:

Building UE4Editor...
Compiling game modules for hot reload
Compiling with MacOSX SDK 10.11
ERROR: One or more of the modules specified using the '-module' argument could not be found.
Command /Users/Shared/UnrealEngine/4.11/Engine/Build/BatchFiles/Mac/RocketBuild.sh failed with exit code 5

But when I hit the compile button in the UE4Editor, the compilation is success.

Can I just press the “Play” button in xcode? or should I change into UE4Editor everytime i want to compile the project?

Thank you,
Rizy

This is not a final answer of any sort, but to have better luck with hot reload, I start the Editor from within XCode (pressing the “Build” button that is a graphic of a right-pointing arrow), then make my C++ changes in XCode, after which I pull down the “Product” menu and select Build. This usually causes the Hot reload to work. If it doesn’t, I close the editor and press the Build button to restart it. I started doing this because adding some UFUNCTION or UPROPERTY statements would simply not be recognized in the editor within the blueprints that needed them, until I did.

If I open the uproject file, it will eventually stop hot reloading though it will compile for awhile but then stop for reasons unknown to me. I open it that way if I’m not adding any UFUNCTION or UPROPERTY Macros (i.e., am making no more than code changes to existing classes). Starting the editor this way, when hot reloading stops, If I close the editor and reopen it, it will usually start hot reloading again.

I say this is not an answer because first, I’m sure they didn’t design it to work this way, and second, I’m just working around a problem I don’t understand, so one can repeat “superstitions” that may not be necessary. The “magic” surrounding this seems to have changed a bit since 4.10/4.11 since the XCode Schemes have changed. I have seen a few “questions” on this, but no response from Epic, so I would guess those of us who experience it, have something unique in our projects and it’s not been recreated.

Another possible pitfall that brings this error. Be sure you select your project name in the schemes and not “UE4_Build”. That scheme always appears to bring this error up.