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

[RC1] Cannot build MAUI library #6052

Closed
emorell96 opened this issue Apr 13, 2022 · 8 comments
Closed

[RC1] Cannot build MAUI library #6052

emorell96 opened this issue Apr 13, 2022 · 8 comments
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/android 🤖 platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@emorell96
Copy link

emorell96 commented Apr 13, 2022

Description

I cannot build my MAUI library on RC1.

It was all working on Preview 14, now I get these errors:

2>C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm'.
2>C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm-aot'.

Steps to Reproduce

  1. Clone the branch rc1-build-failing in https://github.com/StockDrops/OpenStockApp
  2. Build the library OpenStockApp.Core.Maui
  3. The build fails with:
2>C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm'.
2>C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm-aot'.

I have tried updating nugets, removing the vs folder, restarting VS. I don't know why this build error happens.

Version with bug

Release Candidate 1 (current)

Last version that worked well

Preview 14

Affected platforms

Android, Windows

Affected platform versions

API 30, Android 11, Windows 10.0.19041

Did you find any workaround?

Move all the MSAL related code to the main MAUI application away from your MAUI Library.

Relevant log output

1>Time Elapsed 00:00:00.35
4>    Found Java SDK version 11.0.12.
4>  Target _CheckInstantRunCondition:
4>    Dex Fast Deployment Enabled: False
4>  Target _ResolveMonoAndroidSdks:
4>    MonoAndroid Tools: C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.300-rc.1.4\tools\
4>    Android Platform API level: 31
4>    TargetFrameworkVersion: v6.0
4>    Android NDK:
4>    Android SDK: C:\Program Files (x86)\Android\android-sdk\
4>    Android SDK Build Tools: C:\Program Files (x86)\Android\android-sdk\build-tools\30.0.3\
4>    Java SDK: C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot\
4>    Application Java class: android.app.Application
4>  Target _CleanIntermediateIfNeeded:
4>    Skipping target "_CleanIntermediateIfNeeded" because all output files are up-to-date with respect to the input files.
4>  Target _ExtractAar:
4>    Skipping target "_ExtractAar" because it has no inputs.
4>  Target _GetProjectReferenceTargetFrameworkProperties:
4>  Target ResolveProjectReferences:
4>  Target _ResolveLibraryProjectImports:
4>    Skipping target "_ResolveLibraryProjectImports" because all output files are up-to-date with respect to the input files.
4>  Target _BuildLibraryImportsCache:
4>    Skipping target "_BuildLibraryImportsCache" because all output files are up-to-date with respect to the input files.
4>  Target _GenerateAndroidResourceDir:
4>    Skipping target "_GenerateAndroidResourceDir" because all output files are up-to-date with respect to the input files.
4>  Target _GenerateLayoutBindings:
4>    Skipping target "_GenerateLayoutBindings" because it has no outputs.
4>  Target _ConvertResourcesCases:
4>    Skipping target "_ConvertResourcesCases" because all output files are up-to-date with respect to the input files.
4>  Target _CompileResources:
4>    Skipping target "_CompileResources" because all output files are up-to-date with respect to the input files.
4>  Target _PrepareUpdateAndroidResgen:
4>    Skipping target "_PrepareUpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
4>  Target _UpdateAndroidResgen:
4>    Skipping target "_UpdateAndroidResgen" because all output files are up-to-date with respect to the input files.
4>  Target _CreateAar:
4>    Skipping target "_CreateAar" because it has no inputs.
4>  Target CoreResGen:
4>    No resources are out of date with respect to their source files. Skipping resource generation.
4>  Target GenerateTargetFrameworkMonikerAttribute:
4>    Skipping target "GenerateTargetFrameworkMonikerAttribute" because all output files are up-to-date with respect to the input files.
4>  Target CoreGenerateAssemblyInfo:
4>    Skipping target "CoreGenerateAssemblyInfo" because all output files are up-to-date with respect to the input files.
4>  Target _ComputeSkipAnalyzers:
4>    Skipping analyzers to speed up the build. You can execute 'Build' or 'Rebuild' command to run analyzers.
4>  Target CoreCompile:
4>    Skipping target "CoreCompile" because all output files are up-to-date with respect to the input files.
4>  Target _TouchLastBuildWithSkipAnalyzers:
4>    Touching "obj\Debug\net6.0-android\OpenStockApp.Core.Maui.csproj.BuildWithSkipAnalyzers".
4>  Target GetCopyToOutputDirectoryItems:
4>    Target _GetCopyToOutputDirectoryItemsFromTransitiveProjectReferences:
4>  Target CopyFilesToOutputDirectory:
4>    OpenStockApp.Core.Maui -> C:\Users\emore\source\repos\OpenStockApp\OpenStockApp\OpenStockApp.Core.Maui\bin\Debug\net6.0-android\OpenStockApp.Core.Maui.dll
4>
4>Build FAILED.
4>
4>C:\Program Files\dotnet\packs\Microsoft.iOS.Windows.Sdk\15.4.100-rc.1.125\tools\msbuild\iOS\Xamarin.Messaging.Apple.targets(31,3): warning : There is no available connection to the Mac. Task 'VerifyXcodeVersion' will not be executed
4>C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm'.
4>C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm-aot'.
4>    1 Warning(s)
4>    2 Error(s)
@emorell96 emorell96 added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Apr 13, 2022
@kristinx0211 kristinx0211 added s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Apr 13, 2022
@kristinx0211
Copy link

can be reproduced on windows with vs 17.3.0 Preview 1.0 [32411.352.main].

@emorell96
Copy link
Author

emorell96 commented Apr 13, 2022

<PackageReference Include="Microsoft.Identity.Client" Version="4.43.0" /> this line seems to cause this exception.

Something with MSAL isn't happy with MAUI.

Why is it trying to build for win10-arm? I have no need for that platform but I need MSAL on my app.

@emorell96
Copy link
Author

Also if I remove the window targets from the csproj the error also goes away.

@emorell96
Copy link
Author

I tried moving the MSAL dependency to a NET6 library. But that still causes the error even if the MAUI library doesn't have a direct dependency on MSAL. Guys MAUI is pretty cool but why does it have to break so often? This app was almost publish ready now I am back to 0 without MSAL working.

@emorell96
Copy link
Author

can be reproduced on windows with vs 17.3.0 Preview 1.0 [32411.352.main].

Is there any way to exclude win10-arm and win10-arm-aot from the compilation without modifying MAUI? With like an addition to the csproj? I'd like to test RC1 but I cannot if I cannot use MSAL but I have 0 need to support win10-arm. It's like what? 2% of the marketshare of PCs on Windows?

@emorell96
Copy link
Author

I was able to workaround this by moving all MSAL stuff to the main application and not in the library. It is something.

emorell96 added a commit to StockDrops/OpenStockApp that referenced this issue Apr 13, 2022
Removed msal references in the MAUI library
@Eilon Eilon added the area-setup Installation, setup, requirements, maui-check, workloads, platform support label Apr 13, 2022
@shunkino
Copy link

I had the exact same issue while installing Microsoft.WindowsAppSDK 1.0.2 and 1.1.0-preview1 to .NET 6 WinForms app.
Error I got:

1>C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm'.
1>C:\Program Files\dotnet\sdk\6.0.202\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(427,5): error NETSDK1082: There was no runtime pack for Microsoft.WindowsDesktop.App.WindowsForms available for the specified RuntimeIdentifier 'win10-arm-aot'.

My workaround is to add following RuntimeIdentifiers property in csproj explicitly and avoid check for 'win-arm' and 'win10-arm-aot'. (I don't need ARM support for my app.)

    <RuntimeIdentifiers>win10-x64</RuntimeIdentifiers>

It feels strange as I thought WindowsForms in .NET 6 supports ARM architecture too.

@Redth
Copy link
Member

Redth commented Apr 20, 2022

This will be fixed in RC2

@Redth Redth closed this as completed Apr 20, 2022
@ghost ghost locked as resolved and limited conversation to collaborators May 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-setup Installation, setup, requirements, maui-check, workloads, platform support platform/android 🤖 platform/windows 🪟 s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants