天天看點

IOS錯誤Could not produce class with ID

Unity 5.3.5f1 (IL2CPP)編譯IOS版本

XCode Version 7.2.1 (7C1002)

Mac OS X 10.11.3 (15D21) (Mac mini)

iPhone 5,6 ,iPad

Could not produce class with ID XXX.

This could be caused by a class being stripped from the build even though it is needed. Try disabling 'Strip Engine Code' in Player Settings.:<LoadWWWIEnumerator>c__Iterator99:MoveNext()

具體表現:可能是APP閃退,提示上示錯誤資訊

1. 在上面的錯誤提示中,有提示 disabling “Strip Engine Code”

是以我們要做的就是在Player Setting – Other Setting,去掉勾選 Strip Engine

IOS錯誤Could not produce class with ID

如果要Strip Engine,那就需要把不想被strip的添加進來。

1. 建立link.xml放在Assets目錄下,裡面添加不想被strip的dll的名字

下面是導入高通Vuforia之後,SDK中預設的link.xml的内容

<a></a>

如果提示的ID的是Editor的,比如 AnimatorController(ID 91)屬于Editor包裡的,不能用link.xm加回來,可以在Resource下建一個空的prefab,在上面挂一個AnimatorController,打包時留下這個prefab就可以確定這個類不被strip掉了。

以Unity5.3.5為例

ios平台,預設勾選了 Strip Engine Code,且Script Background為I2CPP

IOS錯誤Could not produce class with ID

android平台,預設disabled Strip Engine Code,且Script Background為Mono2x

IOS錯誤Could not produce class with ID

本文轉自趙青青部落格園部落格,原文連結:http://www.cnblogs.com/zhaoqingqing/p/6080075.html,如需轉載請自行聯系原作者

繼續閱讀