Linker Error trying to find .dylib files

Hi All,

I need your help with a Linker Error. I created a custom C++ class and it compiles ok. But linker is throwing an error. Looks like the linker is missing some dynamic library files (.dylib) and it is not able to find them. Can you guys help me with this error?

I am using Macbook Sierra and UE ver 4.13.

Any help regarding this is greatly appreciated.

Thanks

Here are my error messages:

Running command : Engine/Binaries/DotNET/UnrealBuildTool.exe MyProjectNameEditor Mac Development /Users//Documents/Projects/UnrealProjects/MyProjectName 4.13 - 5/MyProjectName.uproject
Compiling with MacOSX SDK 10.12
Performing 1 actions (4 in parallel)
[1/1] Link UE4Editor-MyProjectName.dylib
ld: can't link with a main executable file '/Users/Shared/UnrealEngine/4.13/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor' for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ERROR: UBT ERROR: Failed to produce item: /Users//Documents/Projects/UnrealProjects/MyProjectName 4.13 - 5/Binaries/Mac/UE4Editor-MyProjectName.dylib






Parsing headers for MyProjectNameEditor


  Running UnrealHeaderTool "/Users//Documents/Projects/UnrealProjects/MyProjectName 4.13 - 5/MyProjectName.uproject" "/Users//Documents/Projects/UnrealProjects/MyProjectName 4.13 - 5/Intermediate/Build/Mac/MyProjectNameEditor/Development/MyProjectNameEditor.uhtmanifest" -LogCmds="loginit warning, logexit warning, logdatabase error" -Unattended -WarningsAsErrors -installed


Reflection code generated for MyProjectNameEditor in 6.9076571 seconds


Performing 5 actions (4 in parallel)


[1/5] Compile MyProjectName.h


[2/5] Compile MyProjectName.generated.cpp


[3/5] Compile UMyClassNameJNIBridge.cpp


[4/5] Compile MyProjectName.cpp


[5/5] Link UE4Editor-MyProjectName.dylib


clang: error: no such file or directory: '/Users/Shared/UnrealEngine/4.13/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-Core.dylib'


clang: error: no such file or directory: '/Users/Shared/UnrealEngine/4.13/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-CoreUObject.dylib'


clang: error: no such file or directory: '/Users/Shared/UnrealEngine/4.13/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-Engine.dylib'


clang: error: no such file or directory: '/Users/Shared/UnrealEngine/4.13/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor-InputCore.dylib'


clang: error: no such file or directory: '/Users/Shared/UnrealEngine/4.13/Engine/Binaries/Mac/UE4Editor.app/Contents/MacOS/UE4Editor'


ERROR: UBT ERROR: Failed to produce item: /Users//Documents/Projects/UnrealProjects/MyProjectName 4.13 - 5/Binaries/Mac/UE4Editor-MyProjectName.dylib

All,

This is what I think helped with this issue.

For some reason, including ‘Launch’ in the Build.cs file causes this issue. Once I removed the ‘Launch’ from my build.cs file I don’t get this issue at all. However I do need the Launch module as I need to include AndroidJNI.h which is found in the Launch module. In my c++ header file I include the AndroidJNI file this:

#if PLATFORM_ANDROID
	#include "Android/AndroidJNI.h"
	#include "Android/AndroidJava.h"
	#include "Android/AndroidApplication.h"
#endif

Hope this helps someone.