Hello,
I have been trying to build an iOS framework which includes unity as library in the framework. I came across a few guides to do so:
https://www.kodbiro.com/blog/a-great-way-to-integrate-unity-into-the-native-ios-app/#comment-49
# Config instruction
Create a new target, Cocoa touch Framework type, named **UnityOutFramework**
## Do these settings below, for building target successfully.
1. Target all code files in `Classes` and `Libraries`, except `main.mm`,`RegisterMonoModules.h`,`RegisterMonoModules.cpp`.
2. Build Settings -> Header Search Paths: `$(inherited) "$(SRCROOT)/Classes" "$(SRCROOT)" $(SRCROOT)/Classes/Native $(SRCROOT)/Libraries/bdwgc/include $(SRCROOT)/Libraries/libil2cpp/include`
3. Build Settings -> Library Search Paths: `$(inherited) "$(SRCROOT)" "$(SRCROOT)/Libraries"`
4. Build Settings -> Prefix Header: `Classes/Prefix.pch`
5. Build Settings -> Mismatched Return Type: `Yes`
6. Build Settings -> Enable C++ Exceptions: `Yes`
7. Build Settings -> Other Linker Flags: `$(inherited) -weak_framework CoreMotion -weak-lSystem`
8. Build Settings -> Mach-O Type: `Static Library`
## Do these settings below, for supporting multi achitectures.
1. Build Settings -> Achitectures: `Standard achitectures`
2. Build Settings -> Build Avtive Achitecture Only: `No`
This file has been truncated. show original
I managed to compile the framework successfully without any errors, but I got a bunch of errors when I included it in a test app tried it build it. I am kinda stuck now and am not able to proceed any further.
Here is the errors that I encountered:
This is the link to the xcode framework project and the test app:
https://my.pcloud.com/publink/show?code=XZkeiWkZmwNXLdosXMkNvu7fxHuVY4QXnMXX
The unity project that I am trying to include in the framework is this one:
https://github.com/Unity-Technologies/uaal-example
Any help is really appreciated.
Thanks
I fixed this by including “libc++.tbd” in xcode.
I am now stuck on this error:
ld: warning: arm64 function not 4-byte aligned: _unwind_tester from UnityOutFramework.framework/UnityOutFramework(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_AVPlayerViewController", referenced from:
objc-class-ref in UnityOutFramework(FullScreenVideoPlayer.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
EdwinMurari:
I fixed this by including “libc++.tbd” in xcode.
I am now stuck on this error:
ld: warning: arm64 function not 4-byte aligned: _unwind_tester from UnityOutFramework.framework/UnityOutFramework(unwind_test_arm64.o)
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_AVPlayerViewController", referenced from:
objc-class-ref in UnityOutFramework(FullScreenVideoPlayer.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Fixed this too by adding AVKit library.