简体   繁体   中英

Unity3D iOS export error - No matching function for call to 'objc_msgSendSuper'

I tried to export my Unity3D project for iOS, but I keep getting this error:

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'

I also get the following hints:

[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 marks the following lines of code:

UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(willRotateToInterfaceOrientation:duration:), WillRotateToInterfaceOrientationSendFunc, toInterfaceOrientation, duration);

and

UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(didRotateFromInterfaceOrientation:), DidRotateFromInterfaceOrientationSendFunc, fromInterfaceOrientation);

and

UNITY_OBJC_FORWARD_TO_SUPER(self_, [UIViewController class], @selector(viewWillTransitionToSize:withTransitionCoordinator:), ViewWillTransitionToSizeSendFunc, size, coordinator);

I've tested to build the app on a simulated iPhone X (iOS 11.4).

Can anyone tell me how to fix this?

MacOS: HighSierra 10.13.4 Unity3D (Personal): 2018.1.1f1 XCode: 9.4

I have the same issue on Unity 2018.1.3

Managed to compile and run on simulator after turning off "Enable Strict Checking of objc_msgSendCalls" option (Under Project -> Apple LLVM 9.0 Preprocessing).

I don't know much about native iOS developement, so this might be horrible to just ignore such errors. I'm trying to downgrade to Unity 2017.3.1 where I didn't have these errors.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM