stride3d / stride

Stride Game Engine (formerly Xenko)
https://stride3d.net
MIT License
6.43k stars 929 forks source link

[Mobile] Opening *.Android.sln / *.iOS.sln freezes visual studio #543

Open hammeron-art opened 4 years ago

hammeron-art commented 4 years ago

Release Type: GitHub

Version: e6f55ee3ed4c97173a5353faa03fe7686632b7ed

Platform(s): Windows

Describe the bug When I try to open Xenko.Android.sln in Visual Studio it never finishes loading and locks. I can't build the assemblies for Android.

I'm not interested in iOS development for now but I tested Xenko.iOS.sln too and it has the same problem. The other solutions open fine.

I tried msbuild instead from the Developer Command Prompt for VS 2019:

msbuild Xenko.Android.sln /t:Rebuild msbuild Xenko.iOS.sln /t:Rebuild

And they gives this error:

Xenko.Android.sln:

"F:\Xenko\xenko\build\Xenko.Android.sln" (Clean;Build target) (1) -> "F:\Xenko\xenko\build..\sources\engine\Xenko.UI\Xenko.UI.csproj.metaproj" (Clean target) (2) -> "F:\Xenko\xenko\build..\sources\engine\Xenko.Engine\Xenko.Engine.csproj.metaproj" (Clean target) (3) -> "F:\Xenko\xenko\sources\engine\Xenko.Engine\Xenko.Engine.csproj" (Clean target) (11) -> "F:\Xenko\xenko\sources\engine\Xenko.Engine\Xenko.Engine.csproj" (Clean target) (11:5) -> (ResolvePackageAssets target) -> C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(234,5): error NETSDK1005: Assets file 'F:\Xenko\xenko\sources\engine\Xenko.Engine\obj\project.assets.json' doesn't have a target for 'MonoAndroid,Version=v8.1'. Ensure that restore has run and that you have included 'monoandroid81' in the TargetFrameworks for your project. [F:\Xenko\xenko\sources\engine\Xenko.Engine\Xenko.Engine.csproj]

Xenko.iOS.sln:

"F:\Xenko\xenko\build\Xenko.iOS.sln" (Rebuild target) (1) -> "F:\Xenko\xenko\build..\sources\engine\Xenko.Engine\Xenko.Engine.csproj.metaproj" (Rebuild target) (2) -> "F:\Xenko\xenko\sources\engine\Xenko.Engine\Xenko.Engine.csproj" (Rebuild target) (11) -> "F:\Xenko\xenko\sources\engine\Xenko.Engine\Xenko.Engine.csproj" (Clean target) (11:5) -> (ResolvePackageAssets target) -> C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(234,5): error NETSDK1005: Assets file 'F:\Xenko\xenko\sources\engine\Xenko.Engine\obj\project.assets.json' doesn't have a target for 'Xamarin.iOS,Version=v1.0'. Ensure that restore has run and that you have included 'xamarinios10' in the TargetFrameworks for your project. [F:\Xenko\xenko\sources\engine\Xenko.Engine\Xenko.Engine.csproj]

To Reproduce Steps to reproduce the behavior:

  1. Open Xenko.Android.sln in Visual Studio 2019.

Expected behavior Build Xenko.Android.sln so I can build and run a game project for an Android device.

xen2 commented 4 years ago

To quickly help you for the command prompt error, can you please try instead: msbuild Xenko.Android.sln /t:Rebuild /Restore

hammeron-art commented 4 years ago

I forget to mention but I tried restoring in many ways (msbuild, dotnet, nuget) and the problem persists with the same error.

hammeron-art commented 4 years ago

msbuild Xenko.Android.sln /t:Restore,Rebuild

Gives a new error

"F:\Xenko\xenko\build\Xenko.Android.sln" (Restore;Rebuild target) (1) -> "F:\Xenko\xenko\sources\engine\Xenko.Engine.Tests\Xenko.Engine.Tests.Android.cs proj" (_IsProjectRestoreSupported target) (4) -> "F:\Xenko\xenko\build\Xenko.Android.sln" (GetSolutionConfigurationContents targ et) (1:2) -> (ValidateSolutionConfiguration target) -> F:\Xenko\xenko\build\Xenko.Android.sln.metaproj : error MSB4126: The specifie d solution configuration "Debug|" is invalid. Please specify a valid solution c onfiguration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those prope rties blank to use the default solution configuration. [F:\Xenko\xenko\build\Xe nko.Android.sln]

xen2 commented 4 years ago

It should be /Restore and not as a target (it can't be used in the same pass as the build because it needs full reevaluation) So it has to be either:

(1) compact version: msbuild Xenko.Android.sln /Restore /t:Rebuild notice the lack of /t: with restore

(2) otherwise in two commands:

msbuild Xenko.Android.sln /t:Restore
msbuild Xenko.Android.sln /t:Build
hammeron-art commented 4 years ago

The error is the same in all these cases:

msbuild Xenko.Android.sln /Restore /t:Rebuild
msbuild Xenko.Android.sln /t:Rebuild /Restore
msbuild Xenko.Android.sln /t:Restore
msbuild Xenko.Android.sln /Restore
msbuild Xenko.Android.sln /t:Restore,Rebuild

"F:\Xenko\xenko\build\Xenko.Android.sln" (Restore target) (1) -> "F:\Xenko\xenko\sources\engine\Xenko.Engine.Tests\Xenko.Engine.Tests.Android.cs proj" (_IsProjectRestoreSupported target) (4) -> "F:\Xenko\xenko\build\Xenko.Android.sln" (GetSolutionConfigurationContents targ et) (1:2) -> (ValidateSolutionConfiguration target) -> F:\Xenko\xenko\build\Xenko.Android.sln.metaproj : error MSB4126: The specifie d solution configuration "Debug|" is invalid. Please specify a valid solution c onfiguration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those prope rties blank to use the default solution configuration. [F:\Xenko\xenko\build\Xe nko.Android.sln]

Then any Build/Rebuild gives the first error in the issue.

hammeron-art commented 4 years ago

I managed to open the solution using Do not load projects. Then I reloaded the projects manually and Xenko.Core.Tests.Android is the only one that fails with:

Xenko.Core.Tests.Android.csproj : error : The project file cannot be opened by the project system, because it is missing some critical imports or the referenced SDK cannot be found.

Also all the projects in XenkoRuntime.Tests load but their Proprieties window are broken and giving this error:

An error occurred trying to load the project properties window. Close the window and try again. Membro não encontrado. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

Their xml looks very different from the other projects so I guess it's an issue of that old and new project format thing. I remove all the tests and the Debug build worked.