当我尝试构建我的项目时(我已经尝试为安卓和通用视窗平台构建),构建失败,因为在生成的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);
^~~~~~~~(然后,同样的事情继续重复几十个实例。)
发布于 2021-04-23 03:57:50
我得到了同样的问题,切换到英国(从瑞典)解决了它(不是物理上的,更改了系统设置:语言/地区)
https://stackoverflow.com/questions/65429190
复制相似问题