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)

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

时间: 2024-10-24 05:11:44

IOS - unity3d错误Could not produce class with ID的相关文章

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 Could not produce class with ID XXX.This could be caused by a class being stripped from the buil

Unity3D 错误,nativeVideoFrameCallback解决方法。

原地址:http://blog.csdn.net/alking_sun/article/details/23684733 Unity3D在打包安卓应用的时候,一打开游戏就闪退,接入LogCat之后发现有如下的Log: 04-14 10:12:08.283: DEBUG/dalvikvm(23204): Unregistering JNI method Lcom/unity3d/player/UnityPlayer;.nativeVideoFrameCallback:VILII04-14 10:1

ios常见错误之 Failed to instantiate the default view controller for UIMainStoryboardFile &#39;Main&#39; - perhaps the designated entry point is not set?

Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set? 这是因为给你的StoryBoard没有设置默认显示的controller, 解决方法: from:http://my.oschina.net/u/936286/blog/316565 ios常见错误之 Failed to instanti

iOS 发布错误,ERROR ITMS-9000:&quot;Invalid Code Signing Entitlements.Your application Bundles signature code

iOS 发布错误,ERROR ITMS-9000:"Invalid Code Signing Entitlements.Your application Bundles signature code signing entitlements that are not supported on ios ,Specifically, value'*' for key 'com.apple.developer.associated-domains' in 'Payload/'' is not supp

iOS编译错误:Property cannot have array or function type &#39;Block&#39; (aka &#39;void (XXXXView *__st

XXXXView 中的Block错误,原因: typedef void (^Block)(XXXXView *); 在这个demo中忘记写^了,导致此错误 iOS编译错误:Property cannot have array or function type 'Block' (aka 'void (XXXXView *__st

IOS 编译错误,iOS compile error: no visible @interface for &#39;CDVCommandDelegateImpl&#39; declares the selector

把Cordova 升级到 3.6.3 版本后,在变异的使用出现了如下问题 The error: /Volumes/local.uhmuhm.net/projectxxx/htdocs/phonegap/src/Projectxxx/platforms/ios/Projectxxx/Classes/MainViewController.m:154:19: error: no visible @interface for 'CDVCommandDelegateImpl' declares the s

unityCould not produce class with ID 0. This could

unity 打包webgl或者ios,安卓是,加载ab文件突然莫名其妙的报错出了 Could not produce class with ID 0. 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. 这样的bug.但是在编辑器里面没有问题. ![](https:/

android 编译错误 Error:(1, 0) Plugin with id &#39;com.android.application&#39; not found.

在导入一个项目时,由于它本身的gradle版本比较高,你试用比较旧版本的gradle时就报出Plugin with id 'com.android.application' not found.的错误 如果出现如上错误,只需要在build.gradle中添加下面代码即可: (直接加在 android{ } 的外面) buildscript { repositories { jcenter() // or mavenCentral() } dependencies { classpath 'com

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

ORA-01578和ORA-26040--NOLOGGING操作引起的坏块-错误解释和解决方案(文档ID 1623284.1) (一)NOLOGGING操作引起的坏块(ORA-01578和ORA-26040)简介 如果只是错误ORA-01578,而没有伴随ORA-26040,那么这个坏块是由其它的原因引起的坏块,可以尝试使用RMAN的BMR(Block Media Recovery)修复. 如果数据段(表段.索引段)被定义为NOLOGGING属性,那么当NOLOGGING加APPEND.UNRE