问题标签 [il2cpp]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1701 浏览

c++ - 通过 IL2CPP 的 Unity3d 原生 API 可行吗?

我正在考虑访问 Unity3d 的本机 API 并可能创建一个包装库以方便人类使用。为此,我目前正试图弄清楚在打开 IL2CPP 标志的构建期间将 Unity 项目转换为 XCode 项目时究竟会发生什么。

我想知道当 IL2CPP 将 IL 转换为 c++ 时发生的确切过程是什么,为什么该项目仍然包含 DLL 以及最终编译过程有什么特别之处,例如魔法发生在哪里?

欢迎任何关于所描述目标(Unity3d c++ API)可行性的见解和意见。

PS:我知道这样的 API 至少可以说是骇人听闻的,是的,我确实理解,除了 Unity3d 之外,还有其他技术允许将 c++ 用作一等公民,即虚幻引擎。这个问题首先是理论上的。那,我也喜欢 c++ :)

0 投票
1 回答
2456 浏览

xcode - 如何防止在 Unity3d IL2CPP 中剥离托管 dll

我正在使用System.Text.Encoding1252 编码来扩展 ASCII 支持以充分利用字节的第 8 位,到目前为止,当使用 Mono 作为 时Scripting Backend,我将能够防止通过Assets/link.xml文件剥离代码,如下所示:

但是,当我切换到 IL2CPP 时,我遇到了崩溃,因为在构建过程中某些功能已被剥离。即使我Stripping Level在 Unity 的播放器设置中禁用了..

这是我的运行时崩溃日志:

IL2CPP 崩溃:

当我删除preservelink.xml 中的语句时,这与 Mono 中的相同:

这是我如何使用有问题的代码:

非常感谢您!

0 投票
0 回答
854 浏览

ios - unity 5 il2cpp 对 ios 模拟器的支持

现在Unity5的IL2CPP支持IOS模拟器构建了吗?我设法在 xcode 中构建了一个统一导出的项目,但是当它在模拟器模式下运行时,它崩溃并显示消息 dyld: Symbol not found: _CloseZStream。

0 投票
1 回答
2222 浏览

c# - ExecutionEngineException - 使用 parse.com SDK 在 iOS 运行时出错

我们正在使用 Unity3d(版本 5.0.1p1)为 iOS 和 android 创建游戏,并且由于我们使用 Parse.com 数据服务,我们自然而然地使用它来实现远程推送通知。

问题是,在构建游戏并在测试设备(iPhone 4s iOS8.1.2)上运行它之后,我们在游戏启动时遇到了我们无法弄清楚的执行引擎异常。这是一个例外:

新的 Unity Parse SDK 1.5(包含 PNS 功能)刚刚出现了这个问题。我们所知道的是,仅使用 parse sdk 运行一个空项目就可以了,并且通知工作正常,但是在我们的实际项目中,由于异常,设备不会在 parse 中注册通知,所以我们假设有一个parse 和我们正在使用的其他工具之一之间存在冲突。

仅供参考:我们正在使用 IL2CPP 为通用架构构建游戏(我们也在使用 .Net 2.0 子集构建游戏,但我认为这与问题无关)。

感谢您的时间和您的回答。

更新 ::

这次我们尝试使用 Mono(2.x) 构建,我们遇到了几乎相同的异常,变成了这个:

ExecutionEngineException:尝试 JIT 编译方法

'System.Reflection.MonoProperty:StaticGetterAdapterFrame

(System.Reflection.MonoProperty/StaticGetter`1,object)' 使用 aotonly 运行时。

在 System.Reflection.MonoProperty.GetValue(System.Object obj,System.Object[] 索引)

[0x00000] 在:0

在 Parse.ParseInstallation.get_Badge () [0x00000] in :0

在 Parse.ParseInstallation.SetPlatformAutomaticValue () [0x00000] 中

未知>:0

在 Parse.ParseInstallation.SetAutomaticValues () [0x00000] in :0

在 Parse.ParseInstallation.SaveAsync (System.Threading.Tasks.Task toAwait,

CancellationToken cancelToken) [0x00000] in :0

在 Parse.ParseObject+<>c__DisplayClass18.b__17

(System.Threading.Tasks.Task toAwait) [0x00000] in :0

在 Parse.Internal.TaskQueue.Enqueue[Task] (System.Func`2 taskStart, CancellationToken

取消令牌)[0x00000]在:0

在 Parse.ParseObject.SaveAsync (CancellationToken cancelToken) [0x00000] 中

:0

在 Parse.ParseObject.SaveAsync () [0x00000] in :0

在 Parse.ParseInitializeBehaviour.b__0 (System.Byte[] deviceToken) [0x00000] 中

:0

在 Parse.PlatformHooks+<>c__DisplayClass24.b__22 ()

[0x00000] 在:0

在 Parse.PlatformHooks+d__44.MoveNext () [0x00000] 中

未知>:0

UnityEngine.Debug:Internal_LogException(异常,对象)

UnityEngine.Debug:LogException(异常)

Parse.d__44:MoveNext()

希望它能给你们带来更多关于这个问题的细节。

更新 2 ::

我们确切地知道导致异常发生的原因,不幸的是我们无法控制它,当我们注册通知时,我们这样做:

更新 15/06/2015:解析 Unity SDK 1.5.1(il2cpp 脚本后端)

尝试注册解析 PN 时,我们仍然遇到相同的错误:

ExecutionEngineException:尝试调用未生成提前 (AOT) 代码的方法“System.Reflection.MonoProperty::StaticGetterAdapterFrame”。System.Reflection.MonoProperty+GetterAdapter.Invoke (System.Object _this) System.Reflection.MonoProperty+GetterAdapter.Invoke (System.Object _this) CurvedText.OnRectTransformDimensionsChange () System.Reflection.MonoProperty.GetValue (System.Object obj, System. Object[] index) Newtonsoft.Json.Bson.BsonString.set_IncludeLength (布尔值) Parse.ParseInstallation.get_Badge () Parse.ParseInstallation.SetPlatformAutomaticValue () Parse.ParseInstallation.SetAutomaticValues () Parse.ParseInstallation.SaveAsync (System.Threading.Tasks .Task toAwait, CancellationToken cancelToken) Parse.PlatformHooks+<>c__DisplayClass42.b__36 (System.2 taskStart, CancellationToken cancellationToken) Parse.ParseObject.SaveAsync (CancellationToken cancellationToken) Parse.ParseObject.SaveAsync () Parse.ParseInitializeBehaviour.b__0 (System.Byte[] deviceToken) FlurryAnalyticsIOS.SetSessionTimeout (Int32 seconds) Newtonsoft.Json.Bson.BsonString.set_IncludeLength (Boolean value) Parse.PlatformHooks+<>c__DisplayClass24.b__22 () System.Action.Invoke () Newtonsoft.Json.Bson.BsonString.set_IncludeLength (Boolean value) Parse.PlatformHooks+d__44.MoveNext () System.Array+InternalEnumerator1[System.UInt64].get_Current () UnityEngine.Debug:LogException(Exception) Parse.d__44:MoveNext() System.InternalEnumerator`1:get_Current()

0 投票
2 回答
1759 浏览

json - JsonFx 与 IL2CPP

构造函数不使用 IL2CPP。这是我得到的日志。

MissingMethodException:找不到方法:'未找到默认构造函数... ctor() of System.ComponentModel.ByteConverter'。在 System.ArgumentNullException..ctor (System.String paramName) [0x00000] in :0 在 System.Activator.CreateInstance (System.Type 类型,布尔非公共) [0x00000] 在 :0 在 System.Activator.CreateInstance (System.Type type) [0x00000] in :0 at System.ComponentModel.TypeDescriptor.GetConverter (System.Type type) [0x00000] in :0 at JsonFx.Json.TypeCoercionUtility.CoerceType (System.Type targetType, System.Object value) [0x00000]在 :0 在 JsonFx.Json.JsonReader.ReadNumber (System.Type expectedType) [0x00000] 在 :0 在 JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] 在 :0
在 JsonFx.Json.JsonReader.ReadArray (System.Type arrayType) [0x00000] in :0 在 JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] 在 :0
在 JsonFx.Json.JsonReader。 ReadObject (System.Type objectType) [0x00000] in :0 at JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] in :0 at JsonFx.Json.JsonReader.ReadObject (System.Type objectType) [0x00000] 在 :0 在 JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] 在 :0 在 JsonFx.Json.JsonReader.ReadObject (System.Type objectType) [0x00000] 在 :0 在JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] in :0
在 JsonFx.Json.JsonReader.ReadObject (System.Type objectType) [0x00000] 在:0 在 JsonFx.Json.JsonReader.Read (System.Type expectedType, Boolean typeIsHint) [0x00000] 在:0 在 JsonFx.Json.JsonReader。反序列化(Int32 开始,System.Type 类型)[0x00000] 在:0 在 JsonFx.Json.JsonReader.Deserialize(System.String 值,Int32 开始,System.Type 类型)[0x00000] 在:0 在 JsonFx.Json.JsonReader .Deserialize[BGS] (System.String value) [0x00000] in :0 at GameData.ParseJson () [0x00000] in :0 at GameData.loaddata () [0x00000] in :0 at mainmenuUI.Start () [0x00000]在:0 在 System.Array+InternalEnumerator 1[System.Collections.Hashtable+Slot].get_Current () [0x00000] in <filename unknown>:0 System.InternalEnumerator1:get_Current()

0 投票
1 回答
6753 浏览

unity3d - UnusedBytecodeStripper2.exe 没有正常运行

我正在尝试让我的 iOS 游戏为 iOS 构建。我将脚本后端设置为 IL2CPP(armv7 和 arm64),但出现以下错误。

我使用MobileMoveScript Plugin 2.1.3Mobile Social Plugin 6.6。我认为插件没有任何问题,因为我尝试单独构建它们并且它有效。

运行失败

/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper2/UnusedBytecodeStripper2.exe -out "/Users/abeltherock007/Documents/Unity Projects/Talking Superstar 2/Temp/StagingArea/Data/Managed" -l none -c链接 -x "/Applications/Unity/Unity.app/Contents/Frameworks/Tools/UnusedByteCodeStripper/native_link.xml" -f "/Applications/Unity/Unity.app/Contents/Frameworks/il2cpp/LinkerDescriptors" -x "/Users /abeltherock007/Documents/Unity Projects/Talking Superstar 2/Temp/StagingArea/Data/Managed/../platform_native_link.xml" -x "/Users/abeltherock007/Documents/Unity Projects/Talking Superstar 2/Temp/StagingArea/Data/ methods_pointedto_by_uievents.xml" -x "/Users/abeltherock007/Documents/Unity Projects/Talking Superstar 2/Assets/link.xml" -d "/Users/abeltherock007/Documents/Unity Projects/Talking Superstar 2/Temp/StagingArea/Data/Managed" -a "/Users/abeltherock007/Documents/Unity Projects/Talking Superstar 2/Temp/StagingArea/Data/Managed/Assembly-CSharp .dll" -a "/Users/abeltherock007/Documents/Unity Projects/Talking Superstar 2/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll"


标准输出;Mono CIL 链接器 Mono.Cecil.AssemblyResolutionException 中的致命错误:无法解析程序集:Mono.Linker.LinkContext.Resolve 处的“U3DXTCore,Culture=neutral,PublicKeyToken=null”(IMetadataScope 范围)[0x00000] 在 Mono.Linker 处:0 .Steps.ResolveFromXmlStep.GetAssembly (Mono.Linker.LinkContext context, System.String assemblyName) [0x00000] in :0 在 Mono.Linker.Steps.ResolveFromXmlStep.ProcessAssemblies (Mono.Linker.LinkContext context, System.Xml.XPath.XPathNodeIterator迭代器)[0x00000] 在:0 在 Mono.Linker.Steps.ResolveFromXmlStep.Process () [0x00000] 在:0 在 Mono.Linker.Steps.BaseStep.Process(Mono.Linker.LinkContext 上下文)[0x00000] 在:0在 Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext 上下文) [0x00000] 在 Mono.Linker.Driver.Run () [0x00000] 在 Mono.Linker:0 中。

UnityEngine.Debug:LogError(Object) UnityEditorInternal.Runner:RunManagedProgram(String, String, String, CompilerOutputParserBase) UnityEditorInternal.AssemblyStripper:RunAssemblyLinker(IEnumerable`1, String&, String&, String, String) UnityEditorInternal.AssemblyStripper:StripAssembliesTo(String, String, String&, String&, String, String, IEnumerable`1) UnityEditorInternal.AssemblyStripper:Strip(String, String, String&, String&, String, String, IEnumerable`1) UnityEditorInternal.AssemblyStripper:Strip(String[], String[], String, String, String&, String&, String, String, IEnumerable`1) UnityEditorInternal.IL2CPPBuilder:RunAssemblyStripper(IEnumerable, String, String[], String[], String) UnityEditorInternal.IL2CPPBuilder:StripAssemblies(String[], String) UnityEditorInternal.IL2CPPBuilder:Run() UnityEditorInternal.IL2CPPUtils:RunIl2Cpp(String, String, IIl2CppPlatformProvider, Action`1, RuntimeClassRegistry) UnityEditor.HostView:OnGUI()

0 投票
0 回答
691 浏览

ios - Unity iOS 64 位在 com.apple.IOAccelerator.BlockFences 构建崩溃,异常子类型:KERN_INVALID_ADDRESS

我正在使用 Unity 4.6.6f2 并构建 il2cpp 以支持来自苹果的 64 位要求。我遇到了奇怪的随机崩溃,在设备崩溃日志中,我看到了这些崩溃报告。它发生在多个设备上,它们都有一个共同点:这是日志:

0 投票
2 回答
893 浏览

ios - IL2CPP:iOS 构建 NeatPlug 的链接错误 - Flurry Analytics 插件(通用)

我们在 Unity 游戏中使用 Neatplug 的 Flurry 分析插件。在我们将 unity 更新到 5.1.1P1 版本之前,一切都很顺利。这样做会使 iOS 构建(链接)在 xcode 中失败(使用 IL2CPP 脚本后端,以通用架构为目标)。这是错误:

ld:警告:忽略文件/.../Libraries/Plugins/iOS/libflurry-analytics-plugin-simulator.a,文件/.../Libraries/Plugins/iOS/libflurry-analytics-plugin-中缺少所需的架构arm64 Simulator.a(2 片)ld:警告:忽略文件 /.../Libraries/Plugins/iOS/libsmart-iap-plugin-simulator.a,在文件 /.../Libraries/Plugins/iOS 中缺少所需的架构 arm64 /libsmart-iap-plugin-simulator.a(2 片)

架构 arm64 的未定义符号:“_SecItemUpdate”,引用自:-[FlurryKeychainWrapper updateValueData:forKey:] in libFlurry.a(libFlurry.a-arm64-master.o) “_kSecValueData”,引用自:-[FlurryKeychainWrapper setData:forKey: ] 在 libFlurry.a(libFlurry.a-arm64-master.o) -[FlurryKeychainWrapper updateValueData:forKey:] 在 libFlurry.a(libFlurry.a-arm64-master.o)
“_kSecAttrAccessibleWhenUnlocked”,引用自:-[FlurryKeychainWrapper setData:forKey:] in libFlurry.a(libFlurry.a-arm64-master.o) “_kSecAttrAccessible”,引用自:-[FlurryKeychainWrapper setData:forKey:] in libFlurry.a( libFlurry.a-arm64-master.o) "_SecItemDelete",引用自:-[FlurryKeychainWrapper removeObjectForKey:] in libFlurry.a(libFlurry.a-arm64-master.o) "_SecItemAdd",引用自:-[FlurryKeychainWrapper setData: forKey:] in libFlurry.a(libFlurry.a-arm64-master.o) "_kSecMatchLimitOne",引用自:-[FlurryKeychainWrapper dataForKey:] in libFlurry.a(libFlurry.a-arm64-master.o)
“_OBJC_CLASS_$_SKProductsRequest”,引用自:libsmart-iap-plugin.a(SmartIAP.o) 中的 objc-class-ref -master.o) "_kSecClass",引用自:-[FlurryKeychainWrapper setupSearchForKey:] in libFlurry.a(libFlurry.a-arm64-master.o) "_kSecAttrService",引用自:-[FlurryKeychainWrapper setupSearchForKey:] in libFlurry.a (libFlurry.a-arm64-master.o)
“_OBJC_CLASS_$_SKMutablePayment”,引用自:libsmart-iap-plugin.a(SmartIAP.o) 中的 objc-class-ref “_kSecClassGenericPassword”,引用自:libFlurry.a(libFlurry.a-arm64) 中的 -[FlurryKeychainWrapper setupSearchForKey:] -master.o) "_kSecAttrAccount",引用自:-[FlurryKeychainWrapper setupSearchForKey:] in libFlurry.a(libFlurry.a-arm64-master.o) "_kSecAttrGeneric",引用自:-[FlurryKeychainWrapper setupSearchForKey:] in libFlurry.a (libFlurry.a-arm64-master.o) "_kSecMatchLimit",引用自:-[FlurryKeychainWrapper dataForKey:] in libFlurry.a(libFlurry.a-arm64-master.o) "_kSecReturnData",引用自:-[FlurryKeychainWrapper dataForKey :] 在 libFlurry.a(libFlurry.a-arm64-master.o)
“_OBJC_CLASS_$_SKPaymentQueue”,引用自:libsmart-iap-plugin.a(SmartIAP.o) 中的 objc-class-ref:未找到架构 arm64 clang 的符号:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

我们将此发送给 Neatplug 的支持,但没有得到答复。谢谢您的帮助

0 投票
2 回答
1046 浏览

xcode - 为 iOS 构建 Unity 项目时解析相关错误(不支持文化名称中性)

我已经尝试为 iOS 构建游戏一周了,我想我只是寻求帮助。我已经让它在 Android 和 Windows Phone 上运行。

详细信息: 版本:Unity 5.1.1p2

我正在通过打开脚本调试的 Unity 构建开发版本。

脚本后端:IL2Cpp
架构:通用
SDK 版本:模拟器 SDK

Xcode:
Xcode 版本 6.3.2
iOS 部署目标 7.1
iPhone Simulator SDK 8.3

解析版本:1.5.2

应用程序构建良好。但是一旦它开始在模拟器上运行,它就会以 Il2CppExceptionWrapper 中断:

从堆栈中,我可以看出这在 ParseInitializeBehavior 期间会中断。这是我在堆栈跟踪中看到的,从外到内:

  1. ParseInitializeBehavior_Awake
  2. ParseInitializeBehavior_Initialize
  3. 解析客户端
  4. ParseClient_get_Version()
  5. ParseName --- 在这个函数中 ___assemblyName 的值是:Parse.Unity, Version=1.5.2.0, Culture=neutral, PublicKeyToken=null
  6. CultureInfo_CreateCulture(名称 = “中性”)
  7. CultureInfo_ctor
  8. CultureInfo_ConstructInternalLocaleFromName

引发“不支持文化名称中立”

0 投票
0 回答
1298 浏览

ios - Unity3d 的 il2cpp 编译错误

我正在尝试编译我的 Unity3d C# 脚本以在适用于 iOS 的 arm64 设备上运行。

Unity 构建生成的 xCode 项目没有问题,但 xCode 构建会产生一些语义问题错误:

当我开始使用micro msclib并使用这里建议的 link.xml 文件时发生这种情况(http://docs.unity3d.com/Manual/iphone-playerSizeOptimization.html)没有帮助。另外,我不知道在我的情况下我必须在 link.xml 文件中放入什么。

编辑:我刚刚发现发生这种情况是因为我将兼容性级别设置为.net 2.0 subset。我仍然不知道我正在使用哪些类导致此错误。