-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet new android
attempts to restore Microsoft.AspNetCore.App.Runtime.linux-arm64
#19891
Comments
/cc @dsplaisted @wli3 |
Context: dotnet/sdk#19891 If you `dotnet new android` and `dotnet build` it without a `NuGet.config` you hit: error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm64 with version (= 6.0.0-rc.1.21417.2) I found I could workaround the problem by removing `linux-*` packages at a certain point during the build: <Target Name="_RemoveLinuxFrameworkReferences" AfterTargets="ProcessFrameworkReferences"> <ItemGroup> <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" /> <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> </ItemGroup> </Target> With this target in place, I can build projects without a `NuGet.config` file. Let's put this workaround in place until we have another solution for dotnet/sdk#19891. To validate these changes, I removed any instances of the `dotnet6` feed in our MSBuild tests.
Context: dotnet/sdk#19891 If you `dotnet new android` and `dotnet build` it without a `NuGet.config` you hit: error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm64 with version (= 6.0.0-rc.1.21417.2) I found I could workaround the problem by removing `linux-*` packages at a certain point during the build: <Target Name="_RemoveLinuxFrameworkReferences" AfterTargets="ProcessFrameworkReferences"> <ItemGroup> <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" /> <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> </ItemGroup> </Target> With this target in place, I can build projects without a `NuGet.config` file. Let's put this workaround in place until we have another solution for dotnet/sdk#19891. To validate these changes, I removed any instances of the `dotnet6` feed in our MSBuild tests.
Oh, this did come up before: #11289 |
…6207) Context: dotnet/sdk#19891 If you `dotnet new android` and `dotnet build` it without a `NuGet.config` you hit: error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm64 with version (= 6.0.0-rc.1.21417.2) I found I could workaround the problem by removing `linux-*` packages at a certain point during the build: <Target Name="_RemoveLinuxFrameworkReferences" AfterTargets="ProcessFrameworkReferences"> <ItemGroup> <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" /> <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> </ItemGroup> </Target> With this target in place, I can build projects without a `NuGet.config` file. Let's put this workaround in place until we have another solution for dotnet/sdk#19891. To validate these changes, I removed any instances of the `dotnet6` feed in our MSBuild tests.
…6207) Context: dotnet/sdk#19891 If you `dotnet new android` and `dotnet build` it without a `NuGet.config` you hit: error NU1102: Unable to find package Microsoft.AspNetCore.App.Runtime.linux-arm64 with version (= 6.0.0-rc.1.21417.2) I found I could workaround the problem by removing `linux-*` packages at a certain point during the build: <Target Name="_RemoveLinuxFrameworkReferences" AfterTargets="ProcessFrameworkReferences"> <ItemGroup> <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" /> <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> </ItemGroup> </Target> With this target in place, I can build projects without a `NuGet.config` file. Let's put this workaround in place until we have another solution for dotnet/sdk#19891. To validate these changes, I removed any instances of the `dotnet6` feed in our MSBuild tests.
@jonathanpeppers is this still an issue we should be investigating? |
@marcpopMSFT yes we still have this workaround in place: This at least prevents various Linux files from being added to Android apps. I don't remember if the Linux packages are still being restored or not. |
It appears we still attempt to restore these packages:
Should I do something to work around this? I could probably remove these from some item group in the Android workload. |
We discussed this and think that the Android SDK should probably be able to set |
@dsplaisted it still seems to bring in packs when If you see what we need to do let me know, my changes are on a branch here: |
For reference, here's what iOS had to do to workaround apphost issues: https://github.com/xamarin/xamarin-macios/blob/a6eb528197854c074d9dd5847328c096890337be/dotnet/targets/Xamarin.Shared.Sdk.props#L38-L52 |
I missed |
Context: dotnet/sdk#19891 Context: https://github.com/xamarin/xamarin-macios/blob/a6eb528197854c074d9dd5847328c096890337be/dotnet/targets/Xamarin.Shared.Sdk.props#L38-L52 We currently have a small hack in place to prevent Linux packages from being used in .NET 6 builds: <!-- HACK: workaround for: dotnet/sdk#19891 --> <Target Name="_RemoveLinuxFrameworkReferences" AfterTargets="ProcessFrameworkReferences"> <ItemGroup> <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" /> <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> </ItemGroup> </Target> The Xamarin.iOS team found if you set this late during `$(AfterMicrosoftNETSdkTargets)`: <_RuntimeIdentifierUsesAppHost>false</_RuntimeIdentifierUsesAppHost> <UseAppHost>false</UseAppHost> Then `Microsoft.NETCore.App.Host.*` packs won't be brought in. After making this change, I can remove this line from the workaround: <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> The final solution for dotnet/sdk#19891, will be a future change that makes `Microsoft.AspNetCore.App.Runtime` have a way to ignore unsupported platforms.
Ok great this gets us closer: dotnet/android#6417 So only the |
Context: dotnet/sdk#19891 Context: https://github.com/xamarin/xamarin-macios/blob/a6eb528197854c074d9dd5847328c096890337be/dotnet/targets/Xamarin.Shared.Sdk.props#L38-L52 We currently have a small hack in place to prevent Linux packages from being used in .NET 6 builds: <!-- HACK: workaround for: dotnet/sdk#19891 --> <Target Name="_RemoveLinuxFrameworkReferences" AfterTargets="ProcessFrameworkReferences"> <ItemGroup> <_ProblematicRIDs Include="linux-arm;linux-arm64;linux-x86;linux-x64" /> <PackageDownload Remove="Microsoft.AspNetCore.App.Runtime.%(_ProblematicRIDs.Identity)" /> <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> </ItemGroup> </Target> The Xamarin.iOS team found if you set this late during `$(AfterMicrosoftNETSdkTargets)`: <_RuntimeIdentifierUsesAppHost>false</_RuntimeIdentifierUsesAppHost> <UseAppHost>false</UseAppHost> Then `Microsoft.NETCore.App.Host.*` packs won't be brought in. After making this change, I can remove this line from the workaround: <PackageDownload Remove="Microsoft.NETCore.App.Host.%(_ProblematicRIDs.Identity)" /> The final solution for dotnet/sdk#19891, will be a future change that makes `Microsoft.AspNetCore.App.Runtime` have a way to ignore unsupported platforms.
@jonathanpeppers closing to be tracked by newer discussions we have going on. If this is still a separate issue, feel free to reactivate. |
I think this is fixed, but I'll try removing this target to be sure: |
….linux workaround Context: dotnet/sdk#19891 In 3f052b5, I added a workaround to exclude `Microsoft.AspNetCore.App.Runtime.linux` packages from Android builds. This was a problem where the `android` RID "inherited" from the `linux` RID, and so we ended up with unintended packages restored. This was fixed in dotnet/installer#12702, so we should remove this workaround.
….linux workaround (#6851) Context: dotnet/sdk#19891 In 3f052b5, I added a workaround to exclude `Microsoft.AspNetCore.App.Runtime.linux` packages from Android builds. This was a problem where the `android` RID "inherited" from the `linux` RID, and so we ended up with unintended packages restored. This was fixed in dotnet/installer#12702, so we should remove this workaround.
If you install .NET 6 RC1 and the Android workload, we are now using
**FromWorkload**
so aNuGet.config
should no longer be needed when building Android projects.Unfortunately, you get a different error now when testing this:
Build log: msbuild.zip
I found I could workaround the problem with:
I will probably put this workaround in the Android workload for now.
This is probably related to the RID graph. I tried making an adjustment to the RID graph in the past, but they wouldn't accept this change:
dotnet/runtime#45927
The text was updated successfully, but these errors were encountered: