-
-
Notifications
You must be signed in to change notification settings - Fork 209
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
Fix: NETSDK1139: The target platform identifier android was not recognized #3764
Conversation
The specific source of the error is line 117 here: <!-- Skip this target for design time builds when there are missing workload packs.
This will prevent design time builds from failing and therefore allow
Visual Studio to collect the workloads from the GetSuggestedWorkloads target -->
<Target Name="_CheckForUnsupportedTargetPlatformIdentifier"
BeforeTargets="_CheckForInvalidConfigurationAndPlatform;RunResolvePackageDependencies;GetFrameworkPaths;GetReferenceAssemblyPaths;CollectPackageReferences"
Condition="'$(TargetPlatformIdentifier)' != '' and '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), 5.0)) And ('$(DesignTimeBuild)' != 'true' Or '@(MissingWorkloadPack)' == '')" >
<PropertyGroup>
<TargetPlatformSupported Condition="'$(TargetPlatformIdentifier)' == 'Windows'">true</TargetPlatformSupported>
<UseWorkloadsSpecificError Condition="($(TargetPlatformIdentifier) == 'ios' or $(TargetPlatformIdentifier) == 'tvos' or $(TargetPlatformIdentifier) == 'maccatalyst' or $(TargetPlatformIdentifier) == 'android' or $(TargetPlatformIdentifier.StartsWith('browser'))) and '$(MSBuildEnableWorkloadResolver)' != 'true'">true</UseWorkloadsSpecificError>
</PropertyGroup>
<NETSdkError Condition="'$(TargetPlatformSupported)' != 'true' and '$(UseWorkloadsSpecificError)' != 'true'"
ResourceName="UnsupportedTargetPlatformIdentifier"
FormatArguments="$(TargetPlatformIdentifier)" />
<NETSdkError Condition="'$(TargetPlatformSupported)' != 'true' and '$(UseWorkloadsSpecificError)' == 'true'"
ResourceName="UnsupportedTargetPlatformIdentifierWithWorkloadsDisabled"
FormatArguments="$(TargetPlatformIdentifier)" />
</Target> I'm not really sure I understand this check:
In any event, a diagnostic log of one of our failed runs is attached. Initial errorsIt looks like there are some initial errors... some of which appear to be related to the .NET 7 SDK missing (even though we explicitly install this before running line 3667
line 3761
line 76,924
line 76,938
line 323,955
Apparent ErrorsLater eventaully we get the errors that show up in the GitHub console logs... there are 6 of these (for 6 different projects) but they're all more or less the same. Here's one from line 626,480 (the failure happens at the end of this snippet):
|
I suspect but haven't confirmed that this issue actually relates to the net7.0 targets. We're not seeing this issue on our version-5.0.0 branch where we've already dropped net7.0. Rather than trying to do root cause analysis on whatever was broken in the latest windows-2022 image runner version then, we've decided to close this issue and expedite the v5.0.0 release. |
Resolve #3759
Currently investigating.
We don't consistently get this error for the same commit. For example in this build run you can see that in Attempt 1,
dotnet restore
succeeded. Howeverdotnet restore
failed a second attempt on exactly the same commit.Although both runs use a windows-2022 runner, they are using different image versions:
There is no way to force github to use a specific runner image so it looks like the only solution is to determine what the relevant differences are between these two images and see if we can work around the issue in our build scripts 😢
Potentially relevant image differences
These are some of differences that seem like they might be relevant with respect to the specific error we're encountering:
Tracking issue
As this appears to be an issue with the runner rather than our repository, I've opened this issue in the actions/runner repository on github:
#skip-changelog