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

.NET 8 Preview 5: Android Release builds no longer work #32539

Closed
jonathanpeppers opened this issue May 15, 2023 · 3 comments
Closed

.NET 8 Preview 5: Android Release builds no longer work #32539

jonathanpeppers opened this issue May 15, 2023 · 3 comments
Labels
Area-NetSDK Blocking Partner untriaged Request triage from a team member

Comments

@jonathanpeppers
Copy link
Member

Describe the bug

Likely due to the new default for $(SelfContained): #30038

Any Android Release build fails, because it is trying to not be self-contained:

error XALNS7028: System.IO.FileNotFoundException: Could not load assembly 'mscorlib, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Perhaps it doesn't exist in the Mono for Android profile?

Android Release builds are somewhat unique because they have these settings by default:

  • SelfContained=true
  • RuntimeIdentifier= (blank)
  • RuntimeIdentifiers=android-arm;android-arm64;android-x86;android-x64

macOS/MacCatalyst applications may hit a similar issue, but I haven't heard yet.

To Reproduce

  • install the SDK from main/nightly
  • dotnet workload install android
  • dotnet new android
  • dotnet build -c Release

Exceptions (if any)

After setting SelfContained=true by default, it tried to use the host RID:

error NETSDK1082: There was no runtime pack for Microsoft.Android available for the specified RuntimeIdentifier 'osx-x64'.

After setting UseCurrentRuntimeIdentifier=false, it fails with:

error NETSDK1191: A runtime identifier for the property 'SelfContained' couldn't be inferred. Specify a rid explicitly. 

Further technical details

This blocks MAUI scenarios for .NET 8 Preview 5.

@jonathanpeppers
Copy link
Member Author

It appears that if I comment out these lines, set SelfContained=true and UseCurrentRuntimeIdentifier=false everything works again:

<NETSdkError Condition="'$(SelfContained)' == 'true' and '$(RuntimeIdentifier)' == ''"
ResourceName="ImplicitRuntimeIdentifierResolutionForPublishPropertyFailed"
FormatArguments="SelfContained"/>

@jonathanpeppers
Copy link
Member Author

This may get past this problem, waiting to see CI results:

dotnet/android@6d4dd4e

@jonathanpeppers
Copy link
Member Author

UseCurrentRuntimeIdentifier=false plus passing SelfContained=true to only our "inner build" per RID, solved this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-NetSDK Blocking Partner untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

1 participant