运行环境

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

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

如果要Strip Engine

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

1. 新建link.xml放在Assets目录下,里面添加不想被strip的dll的名字

ID查询: https://docs.unity3d.com/Manual/ClassIDReference.html

下面是导入高通Vuforia之后,SDK中默认的link.xml的内容

<linker>
<!-- The following assemblies contain namespaces that should be fully preserved
even when assembly stripping is used. Not excluding the assemblies below from
stripping can result in crashes or various exceptions. -->
<assembly fullname="Vuforia.UnityExtensions">
<namespace fullname="Vuforia" preserve="all"/>
</assembly>
<assembly fullname="System">
<namespace fullname="System.Runtime.InteropServices" preserve="all"/>
<namespace fullname="System.Collections.Generic;" preserve="all"/>
<namespace fullname="System.Linq;" preserve="all"/>
<namespace fullname="System.Text.RegularExpressions;" preserve="all"/>
<namespace fullname="System.IO;" preserve="all"/>
<namespace fullname="System;" preserve="all"/>
</assembly>
</linker>

如果提示的ID的是Editor的,比如 AnimatorController(ID 91)属于Editor包里的,不能用link.xm加回来,可以在Resource下建一个空的prefab,在上面挂一个AnimatorController,打包时留下这个prefab就可以确保这个类不被strip掉了。

参考:https://forum.unity3d.com/threads/could-not-produce-class-with-id-91-ios.267548/

Unity的默认值

以Unity5.3.5为例

ios平台,默认勾选了 Strip Engine Code,且Script Background为I2CPP

android平台,默认disabled Strip Engine Code,且Script Background为Mono2x

IOS错误Could not produce class with ID的更多相关文章

  1. IOS - unity3d错误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) ...

  2. 【ZBar】ios错误ignoring file xxx missing required architecture x86_64 in file

    解决方法: 1.在Project target里"Architectures"设置为:Standard (armv7,armv7s)或者  Standard (armv7,arm6 ...

  3. iOS 错误及解决汇总

    1. iOS 错误 之 http请求 2. iOS 错误 之 Unexpected interface name 'HomeListCell': expected expression 3. iOS ...

  4. ORA-01578和ORA-26040--NOLOGGING操作引起的坏块-错误解释和解决方案(文档ID 1623284.1)

    ORA-01578和ORA-26040--NOLOGGING操作引起的坏块-错误解释和解决方案(文档ID 1623284.1) (一)NOLOGGING操作引起的坏块(ORA-01578和ORA-26 ...

  5. IOS 错误 [UIWebView cut:]: unrecognized selector sent to instance

    那在什么场景中会出现这种情况呢? 如果一个包含文字的输入元素有焦点,然后按钮的点击会导致输入失去焦点,然后接下来在输入时双按会重新得到焦点并从弹出bar中选择剪切复制粘贴,就会导致此error. 也就 ...

  6. android 编译错误 Error:(1, 0) Plugin with id 'com.android.application' not found.

    在导入一个项目时,由于它本身的gradle版本比较高,你试用比较旧版本的gradle时就报出Plugin with id 'com.android.application' not found.的错误 ...

  7. IOS 错误集合以及解决办法(持续整理中)

    1 . 如下错误: app:resource fork, Finder information, or similar detritus not al site:forums.developer.ap ...

  8. 在IOS开发中,属性名为id的处理方法

    在.h 文件中定义属性名为id { int _id; } @property (nonatomic, assign) int id; 在.m 文件中用synthesize声明该属性,会自动生成get和 ...

  9. iOS - 获取安装所有App的Bundle ID

    先导入#import <objc/runtime.h>头文件 使用runtime获取设备上的所有app的bundle id // Class LSApplicationWorkspace_ ...

随机推荐

  1. byte[] 转成图片方法

    /// <summary> /// ImageData 的摘要说明 /// </summary> public class ImageData : IHttpHandler { ...

  2. 哈夫曼(huffman)树和哈夫曼编码

    哈夫曼树 哈夫曼树也叫最优二叉树(哈夫曼树) 问题:什么是哈夫曼树? 例:将学生的百分制成绩转换为五分制成绩:≥90 分: A,80-89分: B,70-79分: C,60-69分: D,<60 ...

  3. Web安全相关(二):跨站请求伪造(CSRF/XSRF)

    简介 CSRF(Cross-site request forgery跨站请求伪造,也被称为“One Click Attack”或者Session Riding,通常缩写为CSRF或者XSRF,是一种对 ...

  4. 百度EChart3初体验

    由于项目需要在首页搞一个订单数量的走势图,经过多方查找,体验,感觉ECharts不错,封装的很细,我们只需要看自己需要那种类型的图表,搞定好自己的json数据就OK.至于说如何体现出来,官网的教程很详 ...

  5. sqlserver 乐观并发模式

    一开始不怎么理解乐观并发模式是什么. 这种模式可以在死锁问题上使用. 在sql中 这样就是乐观并发模式. SqlServer默认开启的是悲观并发模式 例如:

  6. angular-JS模仿Form表单提交

    直接上示例代码,有不懂的欢迎留言: $http({ url: "http://localhost:10086/yuanxin/Conference/ImportExcelDataForBus ...

  7. 设计模式(六)原型模式(Prototype Pattern)

    一.引言 在软件系统中,当创建一个类的实例的过程很昂贵或很复杂,并且我们需要创建多个这样类的实例时,如果我们用new操作符去创建这样的类实例,这未免会增加创建类的复杂度和耗费更多的内存空间,因为这样在 ...

  8. C# - 集合类

    C#的集合类命名空间介绍: // 程序集 mscorlib.dll System.dll System.Core.dll // 命名空间 using System.Collections:集合的接口和 ...

  9. [python] File path and system path

    1. get files in the current directory with the assum that the directory is like this: a .py |----dat ...

  10. SalesForce 记录级别安全性

    对象级安全性 简档 对象级安全性提供了控制 Salesforce.com 中数据的最简单方式.使用对象级安全性 您可以防止用户查看.创 建.编辑或删除特殊类型对象的任何实例 如潜在客户或业务机会.对象 ...