我尝试为iOS导出我的Unity3D项目,但是我一直收到这个错误:
No matching function for call to 'objc_msgSendSuper'
[DIRECTORY]/Classes/UI/UnityViewControllerBase+iOS.mm:166:5: No matching function for call to 'objc_msgSendSuper'
[DIRECTORY]/Classes/UI/UnityViewControllerBase+iOS.mm:180:5: No matching function for call to 'objc_msgSendSuper'
[DIRECTORY]/Classes/UI/UnityViewControllerBase+iOS.mm:210:5: No matching function for call to 'objc_msgSendSuper'
我还得到了以下提示:
[DIRECTORY]/Classes/Unity/ObjCRuntime.h:20:43: Expanded from macro 'UNITY_OBJC_FORWARD_TO_SUPER'
[DIRECTORY]/Classes/Unity/ObjCRuntime.h:11:60: Expanded from macro 'UNITY_OBJC_SEND_MSG'
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator11.4.sdk/usr/include/objc/message.h:65:1: Candidate function not viable: requires 0 arguments, but 4 were provided
XCode标记以下代码行:
UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(willRotateToInterfaceOrientation:duration:), WillRotateToInterfaceOrientationSendFunc, toInterfaceOrientation, duration);
和
UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(didRotateFromInterfaceOrientation:), DidRotateFromInterfaceOrientationSendFunc, fromInterfaceOrientation);
和
UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(viewWillTransitionToSize:withTransitionCoordinator:), ViewWillTransitionToSizeSendFunc, size, coordinator);
我已经测试了在模拟的iPhone X (iOS 11.4)上构建应用程序。
有人能告诉我怎么解决这个问题吗?
MacOS: HighSierra 10.13.4 Unity3D (个人):2018.1.1f1 XCode: 9.4
发布于 2018-06-08 05:05:19
我在Unity 2018.1.3上也有同样的问题
在关闭"Enable Strict Checking of objc_msgSendCalls“选项(在Project -> Apple LLVM9.0预处理下)后,管理编译并在模拟器上运行。
我对原生iOS开发了解不多,所以忽略这样的错误可能是可怕的。我正在尝试降级到Unity 2017.3.1,在那里我没有这些错误。
https://stackoverflow.com/questions/50738137
复制相似问题