[英]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.