简体   繁体   English

Plugin.MediaManager 产生“未知选项”错误

[英]The Plugin.MediaManager produces 'Unknown option' error

on starting a new xamarin forms project and just adding Plugin.MediaManager.Forms v1.1.1 then rebuilding it produces error:在开始一个新的 xamarin forms 项目并添加 Plugin.MediaManager.Forms v1.1.1 然后重建它会产生错误:

Unknown option -RC:\Users\Hp..\flat\values-en-rIN_values-en-rIN.arsc.flat .未知选项-RC:\Users\Hp..\flat\values-en-rIN_values-en-rIN.arsc.flat Please check $(AndroidAapt2CompileExtraArgs) and $(AndroidAapt2LinkExtraArgs) to see if they include any aapt command line arguments that are no longer valid for aapt2 and ensure that all other arguments are valid for aapt2 .请检查$(AndroidAapt2CompileExtraArgs)$(AndroidAapt2LinkExtraArgs)以查看它们是否包含任何对 aapt2 不再有效的aapt命令行aapt2并确保所有其他 arguments 对aapt2有效。

The Line CrossMediaManager.Current.Init();CrossMediaManager.Current.Init(); has been added in constructor.已在构造函数中添加。 The error occurs only if i add MediaManager.仅当我添加 MediaManager 时才会出现该错误。 Ive tried with MediaManager 0.9.7 till 1.1.1 No improvement我已经尝试使用 MediaManager 0.9.7 到 1.1.1 没有改进

Earlier with VS2019 it was working fine.早些时候使用 VS2019 运行良好。

Issue问题

The new Android aapt2 resource tool has different commandline arguments to the older aapt tool.新的 Android aapt2 资源工具与旧的 aapt 工具具有不同的命令行 arguments。 These are generally incompatible with each other.这些通常彼此不兼容。

Solution解决方案

If you are receiving this error, check that the values provided in如果您收到此错误,请检查中提供的值

<AndroidAapt2LinkExtraArgs/>
<AndroidAapt2CompileExtraArgs>

are valid for aapt2.对 aapt2 有效。 You can use aapt2 compile and aapt2 link to view the list of valid arguments.您可以使用 aapt2 编译和 aapt2 链接查看有效 arguments 的列表。

finally i got it enter the following in the Android csproj file最后我得到它在 Android csproj 文件中输入以下内容

<PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0" />
<PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.5" />
 
 ...

in the item group which contains xamarin.forms, xamarin.essentials etc在包含 xamarin.forms、xamarin.essentials 等的项目组中

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 GoogleAppMeasurement.xcframework 的格式不正确或未知,无法处理 - GoogleAppMeasurement.xcframework has an incorrect or unknown format and cannot be processed 为什么设备代码未在 Visual Studio 中显示为登录选项(工具 - 选项 - 帐户)? - Why Device Code Not Showing as a sign in option in Visual Studio (Tools - Options - Accounts)? 我只是无法让 Visual Studio for Mac 调试工作(该选项显示为灰色) - I just can't get the Visual Studio for Mac debugging to work (the option is greyed out) copilot 错误:[错误]“ReturnKeyCommandArgs”发生错误? - copilot error : [Error] An error occurred for 'ReturnKeyCommandArgs'? 没有调试C#代码的选项,只出现IIS Express选项 - No option for debugging C# code, only IIS Express option appears Angular - 获取此 ERROR 错误:尝试区分“[object Object]”时出错。 仅允许 arrays 和可迭代对象 - Angular - Get this ERROR Error: Error trying to diff '[object Object]'. Only arrays and iterables are allowed 错误:不可恢复的构建错误 - 0x8007000B - VS2022 Winforms 项目 C# - ERROR: Unrecoverable build error - 0x8007000B - VS2022 Winforms Project C# Swagger 打开并在 .NET 6 MacOS Visual Studio 2022 预览版中出现错误 1 - Swagger open and giving a error in .NET 6 MacOS Visual Studio 2022 preview 1 如何将自定义菜单命令添加到 VSIX 错误上下文菜单 - How to add custom menu command to VSIX Error Context Menu MVC 4 项目上的 Visual Studio 2022“算术运算导致溢出”错误 - Visual Studio 2022 "Arithmetic operation resulted in an overflow" Error on MVC 4 Project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM