RegisterMonoModules.cpp needs editing to fix error: #endif without #if #endif

RegisterMonoModules.cpp needs editing to fix error: #endif without #if #endif

使用 Unity 5 (B18) 并为 iOS 构建时,出现以下错误:

.../RegisterMonoModules.cpp:87:2: error: #endif without #if #endif // !(TARGET_IPHONE_SIMULATOR) && !defined(__arm64__)

易于修复 - 只需删除生成错误的行上方的 #endif

但是你需要添加 -fno-objc-arc 到 Build Phases to file FbUnityInterface.mm

令我恼火的是,每次构建项目时,RegisterMonoModules.cpp 都需要再次编辑。有没有办法将更改更改为 "stick"?

Facebook-unity-sdk 6.0 和 6.1 中存在同样的问题

将@bjornrun 的评论改编为答案:在 unity 4.6.9 和 facebook 插件 6.2.2 中,我不得不更改代码块中从 [=18= 的第 40 行开始的 data = 行.cs 只是这个:

data = Regex.Replace(data, @"mono_aot_register_module(mono_aot_module_mscorlib_info);", "mono_aot_register_module(mono_aot_module_mscorlib_info);");

在那之后,单声道编译正常。

我也在使用 Heyzap 的插件,我不得不将 HeyzapPostBuild 中的 PostProcessBuild 属性从 102 更改为 99,使其刚好位于 Facebook 的 100 之前。