Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build for Mobile, Xenko.Android.sln and Xenko.iOS.sln don't open #543

Open
hammeron-art opened this issue Oct 26, 2019 · 6 comments
Open
Labels
bug

Comments

@hammeron-art
Copy link

@hammeron-art hammeron-art commented Oct 26, 2019

Release Type: GitHub

Version: e6f55ee

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.

@hammeron-art hammeron-art added the bug label Oct 26, 2019
@hammeron-art hammeron-art changed the title Can't build for Mobile: Xenko.Android.sln and Xenko.iOS.sln doesn't open Can't build for Mobile, Xenko.Android.sln and Xenko.iOS.sln don't open Oct 26, 2019
@xen2

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Oct 26, 2019

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

@hammeron-art

This comment has been minimized.

Copy link
Author

@hammeron-art hammeron-art commented Oct 26, 2019

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

@hammeron-art

This comment has been minimized.

Copy link
Author

@hammeron-art hammeron-art commented Oct 26, 2019

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

This comment has been minimized.

Copy link
Member

@xen2 xen2 commented Oct 26, 2019

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

This comment has been minimized.

Copy link
Author

@hammeron-art hammeron-art commented Oct 26, 2019

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

This comment has been minimized.

Copy link
Author

@hammeron-art hammeron-art commented Oct 27, 2019

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.

xen2 added a commit that referenced this issue Oct 30, 2019
…sary for WinStore/WinPhone port) (this allows command line build for Android/iOS #543)
phr00t added a commit to phr00t/FocusEngine that referenced this issue Oct 31, 2019
…sary for WinStore/WinPhone port) (this allows command line build for Android/iOS xenko3d#543)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.