microsoft / appcenter-sdk-unity

Development repository for the App Center SDK for Unity platforms, including Android, iOS, and UWP
Other
77 stars 40 forks source link

(UWP) A project generated with Unity 2021.2.x cannot build the APPX packages when including AppCenterSDK #513

Open gonzalo-cobos opened 2 years ago

gonzalo-cobos commented 2 years ago

Description

A project in Unity 2021.2.X that includes AppCenterSDK 4.4.0 (or any recent version) won't be able to build for WSAPlayer (UWP). In the file Editor/AppCenterPostBuild.cs, just commenting out this line, the thing works and the packages are built correctly.

FixIl2CppLogging(pathToBuiltProject);

Repro Steps

  1. Create an empty project from Unity 2021.2.x (any version earlier will still work)
  2. Add the AppCenterSDK to it
  3. Build for WSA (it will generate the .sln project)
  4. Go to Visual Studio and try to build the .sln

Details

  1. Which SDK version are you using?
    • 4.4.0
  2. Which platform did you experience the issue on?
    • UWP
  3. What device version did you see this error on? Were you using an emulator or a physical device?
    • Not applicable
  4. What third party plugins are you using?
    • Only AppCenterSDK
  5. Please enable verbose logging for your app using Initial Log Level setting and include the logs here:

    
    
     3>EXEC : error : Unity.IL2CPP.Building.BuilderFailedException: Lump_libil2cpp_icalls.cpp [D:\workspace\CleanUWP\bu
       ild\Il2CppOutputProject\Il2CppOutputProject.vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Diagnostics\Debugger.cpp
       (29): error C2227: left of '->chars' must point to class/struct/union/generic type [D:\workspace\CleanUWP\build\
       Il2CppOutputProject\Il2CppOutputProject.vcxproj]
         D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Diagnostics\Debugger.c
         pp(29): note: type is 'Il2CppString **'
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.h
       (21): error C2059: syntax error: '(' [D:\workspace\CleanUWP\build\Il2CppOutputProject\Il2CppOutputProject.vcxpro
       j]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.h
       (21): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int [D:\workspace\Cl
       eanUWP\build\Il2CppOutputProject\Il2CppOutputProject.vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.h
       (21): error C2059: syntax error: 'constant' [D:\workspace\CleanUWP\build\Il2CppOutputProject\Il2CppOutputProject
       .vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.c
       pp(46): error C2146: syntax error: missing ')' before identifier 'p' [D:\workspace\CleanUWP\build\Il2CppOutputPr
       oject\Il2CppOutputProject.vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.c
       pp(46): error C2065: 'p': undeclared identifier [D:\workspace\CleanUWP\build\Il2CppOutputProject\Il2CppOutputPro
       ject.vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.c
       pp(46): error C2761: 'int il2cpp::icalls::mscorlib::System::Runtime::RuntimeImports::memset(void)': redeclaratio
       n of member is not allowed [D:\workspace\CleanUWP\build\Il2CppOutputProject\Il2CppOutputProject.vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.c
       pp(46): error C2059: syntax error: 'constant' [D:\workspace\CleanUWP\build\Il2CppOutputProject\Il2CppOutputProje
       ct.vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.c
       pp(46): error C2059: syntax error: ')' [D:\workspace\CleanUWP\build\Il2CppOutputProject\Il2CppOutputProject.vcxp
       roj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.c
       pp(47): error C2143: syntax error: missing ';' before '{' [D:\workspace\CleanUWP\build\Il2CppOutputProject\Il2Cp
       pOutputProject.vcxproj]
     3>D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp\icalls\mscorlib\System.Runtime\RuntimeImports.c
       pp(47): error C2447: '{': missing function header (old-style formal list?) [D:\workspace\CleanUWP\build\Il2CppOu
       tputProject\Il2CppOutputProject.vcxproj]
    
         Invocation was: Executable: "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29
         .30133\bin\HostX64\x64\cl.exe"
         Arguments: "D:\workspace\CleanUWP\build\Il2CppOutputProject\Source\lumpedcpp\Lump_libil2cpp_icalls.cpp" /nolog
         o /c /bigobj /W3 /Z7 /EHs /GR- /Gy /utf-8 /wd4102 /wd4800 /wd4056 /wd4190 /wd4723 /wd4467 /wd4503 /wd4996 /wd4
         200 /wd4834 /wd4722 /Ox /Oi /Oy- /GS- /Gw /GF /Zo /MD /DWINDOWS_UWP /DUNITY_UWP /DUNITY_WSA_10_0 /DUNITY_WSA /
         DUNITY_WINRT /DPLATFORM_WINRT /DNET_4_0 /DUNITY_AOT /DIL2CPP_MONO_DEBUGGER_DISABLED /DGC_NOT_DLL /DRUNTIME_IL2
         CPP /DIL2CPP_ENABLE_WRITE_BARRIERS=1 /DIL2CPP_INCREMENTAL_TIME_SLICE=3 /DBASELIB_INLINE_NAMESPACE=il2cpp_basel
         ib /DIL2CPP_DEFAULT_DATA_DIR_PATH=Data/il2cpp_data /DBASELIB_USE_DYNAMICLIBRARY=1 /D_WIN32 /DWIN32 /DWIN32_THR
         EADS /D_WINDOWS /DWINDOWS /D_UNICODE /DUNICODE /D_CRT_SECURE_NO_WARNINGS /D_SCL_SECURE_NO_WARNINGS /D_WINSOCK_
         DEPRECATED_NO_WARNINGS /DNOMINMAX /D_NDEBUG /DNDEBUG /DWINDOWS_SDK_BUILD_VERSION=22000 /D__WRL_NO_DEFAULT_LIB_
         _ /DWINAPI_FAMILY=WINAPI_FAMILY_APP /I"D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp" /I"D:
         \workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\libil2cpp" /I"D:\workspace\CleanUWP\build\Il2CppOutputPro
         ject\IL2CPP\external\bdwgc\include" /I"D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\external\xxHash"
          /I"D:\workspace\CleanUWP\build\Il2CppOutputProject\IL2CPP\external\baselib\Include" /I"D:\workspace\CleanUWP\
         build\Il2CppOutputProject\IL2CPP\external\baselib\Platforms\UniversalWindows\Include" /I"D:\workspace\CleanUWP
         \build\Il2CppOutputProject\IL2CPP\libil2cpp\pch" /I"C:\Program Files (x86)\Microsoft Visual Studio\2019\Commun
         ity\VC\Tools\MSVC\14.29.30133\include" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\shared"
         /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\um" /I"C:\Program Files (x86)\Windows Kits\10\I
         nclude\10.0.22000.0\winrt" /I"C:\Program Files (x86)\Windows Kits\10\Include\10.0.22000.0\ucrt" /Fo"D:\workspa
         ce\CleanUWP\build\build\obj\il2cppOutputProject\x64\Master\libil2cpp\833067854F08C99A6AE32A2CA21B73DC.obj" /Fd
         "D:\workspace\CleanUWP\build\build\obj\il2cppOutputProject\x64\Master\libil2cpp\833067854F08C99A6AE32A2CA21B73
         DC.pdb"
         EnvArg key: PATH value: C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x64;C:\Program Files (x86)\Win
         dows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22000.0\x86;C:\Program Files (x86)\Window
         s Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.29.30133\bin\
         HostX64\x64
    
            at Unity.IL2CPP.Building.CppProgramBuilder.BuildAllCppFiles(IEnumerable`1 sourceFilesToCompile, IBuildStati
         sticsCollector statisticsCollector)
            at Unity.IL2CPP.Building.CppProgramBuilder.Build(IBuildStatistics& statistics)
            at il2cpp.Compilation.CompilationDriver.Run(RuntimePlatform platform, Il2CppCommandLineArguments il2CppComm
         andLineArguments, BuildingOptions buildingOptions, ReadOnlyCollection`1 matchedAssemblyMethodSourceFiles)
            at il2cpp.Program.DoRun(String[] args, RuntimePlatform platform, Il2CppCommandLineArguments il2CppCommandLi
         neArguments, BuildingOptions buildingOptions, Boolean throwExceptions)
     3>C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.MakeFile.Targ
       ets(46,5): error MSB3073: The command ""D:\workspace\CleanUWP\build\Il2CppOutputProject\\IL2CPP\build\deploy\il2
       cpp.exe" --libil2cpp-static --compile-cpp -architecture=x64 -configuration=Release -platform=winrt -outputpath="
       D:\workspace\CleanUWP\build\\build\bin\x64\Master\GameAssembly.dll" --data-folder="D:\workspace\CleanUWP\build\\
       build\bin\x64\Master\\" -cachedirectory="D:\workspace\CleanUWP\build\\build\obj\il2cppOutputProject\x64\Master\\
       " -generatedcppdir="D:\workspace\CleanUWP\build\Il2CppOutputProject\\Source"  --incremental-g-c-time-slice=3 --b
       aselib-directory="C:\Program Files\Unity\Hub\Editor\2021.2.11f1\Editor\Data\PlaybackEngines\MetroSupport\Players
       \UAP\il2cpp\x64\Master" --avoid-dynamic-library-copy --dont-deploy-baselib --profiler-report --additional-define
       s=WINDOWS_UWP --additional-defines=UNITY_UWP --additional-defines=UNITY_WSA_10_0 --additional-defines=UNITY_WSA
       --additional-defines=UNITY_WINRT --additional-defines=PLATFORM_WINRT -dotnetprofile=unityaot-win32 -verbose --re
       lative-data-path=Data/il2cpp_data" exited with code 4. 
DmitriyKirakosyan commented 2 years ago

Hi @gonzalo-cobos , thank you for reporting this issue! I'll mark it as a bug. Can you confirm that you are not blocked on this issue because of the workaround you mentioned?

gonzalo-cobos commented 2 years ago

This is not blocking us at the moment. This bug just prevents us from updating to Unity 2021.2.x for those projects using UWP

hippogamesunity commented 2 years ago

Thanks for the fix suggested! I've spent 2 days on this(