【发布时间】:2021-04-23 03:57:49
【问题描述】:
当我尝试构建我的项目时(我曾尝试为 Android 和通用 Windows 平台构建),由于在生成的 C++ 中使用MINUS SIGN (U+2212) 字符作为负号,构建失败。我在 Unity 2020.2/Android 11 SDK/GPGS 10;我使用 Unity 2019/Android 10 SDK/GPGS 9 成功构建。
我已经在所有 asset、cs、meta、prefab、txt、unity 和 xml 文件中搜索了“-”(以及“2212”,以便更好地衡量)在项目中并没有发现任何东西(除了巧合的文件 ID 616832212、sprite ID 9561e3c67a82d7f448852212eb8fac6b 和技术上匹配的二进制文件)。我还尝试让 Unity 重新安装软件包并重建 Library;不走运。
对于 UWP 构建,我打开 [build output directory]\Il2CppOutputProject\Source\il2cppOutput\Generic8.cpp 并确认“-”字符在文件中以这种方式重复出现 - 例如,
19990:IL_0063:
19991: {
19992: return (int32_t)(−1);
19993: }
19994:}
Android 构建的错误是:
Exception: Unity.IL2CPP.Building.BuilderFailedException: C:\[path to project folder]\Library\Il2cppBuildCache\Android\armeabi-v7a\il2cppOutput\Assembly-CSharp.cpp:20814:155: warning: treating Unicode character <U+2212> as identifier character rather than as '-' symbol [-Wunicode-homoglyph]
AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6(L_1, ((int32_t)<U+2212>3), /*hidden argument*/AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6_RuntimeMethod_var);
^~~~~~~~
C:\[path to project folder]\Library\Il2cppBuildCache\Android\armeabi-v7a\il2cppOutput\Assembly-CSharp.cpp:20814:155: error: non-ASCII characters are not allowed outside of literals and identifiers
AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6(L_1, ((int32_t)<U+2212>3), /*hidden argument*/AndroidClient_InvokeCallbackOnGameThread_TisUIStatus_t34F64DC1927A392210216047169D4E196183BD14_m78B26B077A1A979B11C5596B45DC6E9A1A2929B6_RuntimeMethod_var);
^~~~~~~~
(然后同样的事情继续重复几十个实例。)
【问题讨论】:
-
这真的很有趣也很奇怪。您使用的 unity 完整版本号是多少?
-
听起来你应该将它作为一个错误报告给 unity。
-
@Ruzihm 那是 2020.2.0f1。我最终只是恢复到上一个 LTS 版本 (2019.4.17f1),但没有发生这种情况。
标签: unity3d