最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

c# - Why can't I run Android and iOS versions of the Avalonia UI app on Fedora Linux? - Stack Overflow

programmeradmin2浏览0评论

I set up Fedora Linux with the KDE desktop environment and installed Rider. I also downloaded the necessary templates and plugins. After that, I created a cross-platform Avalonia UI app in Rider, but the Android and iOS parts of the app are throwing compilation errors. I've had this issue before on Windows 11, but back then, I just installed MAUI, and everything worked fine. On Linux, though, MAUI isn't available, so I decided to set up the Android SDK and a virtual Android device using Android Studio.

I downloaded Android Studio, and everything works perfectly there — the emulator runs, and Kotlin apps work without any issues. I thought this would fix the problem in Rider too, but now I'm getting a different error.

Here's what it says:

Microsoft.NET.TargetFrameworkInference.targets(117, 5): [NETSDK1139] The target platform identifier 'android' was not recognized.

When I click on the error, it takes me to the Microsoft.NET.TargetFrameworkInference.targets file and shows this code:

<NETSdkError Condition="'$(TargetPlatformSupported)' != 'true' and '$(UseWorkloadsSpecificError)' != 'true'"
             ResourceName="UnsupportedTargetPlatformIdentifier"
             FormatArguments="$(TargetPlatformIdentifier)" />

<NETSdkError Condition="'$(TargetPlatformSupported)' != 'true' and '$(UseWorkloadsSpecificError)' == 'true'"
             ResourceName="UnsupportedTargetPlatformIdentifierWithWorkloadsDisabled"
             FormatArguments="$(TargetPlatformIdentifier)" />

I also tried installing the Android workload using the following command in the terminal:

dotnet workload install android

But I got this error:

Workload installation failed: Workload ID 'android' is not recognized.

By the way, I’m using .NET 9. I’m not sure what to do about this. Any ideas?

发布评论

评论列表(0)

  1. 暂无评论