IOS错误Could not produce class with ID

IOS错误Could not produce class with ID

https://www.cnblogs.com/zhaoqingqing/p/6080075.html

IOS错误Could not produce class with ID

文章目录[点击收起](?) [-]

  1. 运行环境
  2. 错误信息
    1. Could not produce class with ID
    2. 解决办法
    3. 如果要Strip Engine
    4. Unity的默认值

 

作者:@qingqing-zhao
本文为作者原创,转载请注明出处:https://www.cnblogs.com/zhaoqingqing/p/6080075.html

运行环境

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

image

如果要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

image

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

image

 

 

(2)

Could not produce class with ID 91 - iOS

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

I receive this error when loading my asset bundle. Does anyone know what class ID 91 corresponds to?

It is not listed in the class ID reference page.

http://docs.unity3d.com/Manual/ClassIDReference.html

 

(3)

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


We faced the same issue, the Resources trick works. But I was wondering : Why we can't add the UnityEditor assembly to the link.xml, can someone from UnityTechnologies know ?

I tried UnityEditor, UnityEditor.Animations, nothing works.

 

I think I managed to resolve this by adding 'UnityEngine.RuntimeAnimatorController' to my link.xml

 

(4)

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

 

 

 

 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值