The specified RuntimeIdentifier 'android.21-arm64' is not recognized.

Kim Strasser 661 Reputation points
2024-05-05T12:57:08.6666667+00:00

I get the following error in my Android project:

/usr/local/share/dotnet/sdk/8.0.204/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1083: The specified RuntimeIdentifier 'android.21-arm64' is not recognized. See https://aka.ms/netsdk1083 for more information. [/Users/name/Projects/…/ProjAndroid.csproj] /usr/local/share/dotnet/sdk/8.0.204/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.FrameworkReferenceResolution.targets(90,5): error NETSDK1083: The specified RuntimeIdentifier 'android.21-arm' is not recognized. See https://aka.ms/netsdk1083 for more information. [/Users/name/Projects/…/ProjAndroid.csproj] Unable to create dependency graph file for project '/Users/name/Projects/…/ProjAndroid.csproj'. Cannot add package reference.

I have the following code in my .csproj file:

<Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <TargetFramework>net8.0-android</TargetFramework> <SupportedOSPlatformVersion>31.0</SupportedOSPlatformVersion> <OutputType>Exe</OutputType> <UseMaui>true</UseMaui> <UseMauiEssentials>true</UseMauiEssentials> <SkipValidateMauiImplicitPackageReferences>true</SkipValidateMauiImplicitPackageReferences> <ApplicationId>com.companyname.ProjAndroid</ApplicationId> <ApplicationVersion>1</ApplicationVersion> <ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <WarningLevel>4</WarningLevel> <NoStdLib>false</NoStdLib> <RuntimeIdentifiers>android.21-arm64;android.21-arm</RuntimeIdentifiers> </PropertyGroup> ...

I switched from Visual Studio for Mac to Visual Studio Code on macOS and now I always get this error. I don't know if I need the android.21-arm64;android.21-arm in my .csproj file. Is it necessary to remove or change the .csproj file? What exactly is android.21-arm64;android.21-arm used for?

Not Monitored
Not Monitored
Tag not monitored by Microsoft.
36,404 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Umar 160 Reputation points
    2024-05-05T13:46:36.05+00:00

    Subject: Re: The specified RuntimeIdentifier 'android.21-arm64' is not recognized.

    Dear Kim Strasser,

    Thank you for reaching out with your question. I'm Umar, a member of the support team, and I'm here to help you resolve the issue you're facing with the RuntimeIdentifier in your Android project.

    The error message you're seeing, "The specified RuntimeIdentifier 'android.21-arm64' is not recognized," typically occurs when the specified RuntimeIdentifier is not installed or not supported by the .NET SDK version you're using.

    Here are a few steps you can take to resolve this issue:

    1. Check your installed RuntimeIdentifiers: You can check the installed RuntimeIdentifiers by running the following command in your terminal: dotnet --list-runtimes
    2. Install the necessary RuntimeIdentifier: If 'android.21-arm64' is not listed, you can install it using the following command: dotnet runtime install --runtime android.21-arm64
    3. Update your .NET SDK: If the RuntimeIdentifier is still not recognized, it's possible that your current .NET SDK version does not support it. You can check your installed .NET SDK versions with dotnet --list-sdks and update to the latest version if necessary.

    Please try these steps and let me know if you're still encountering the issue. I'm here to help!

    Best regards,

    Umar