在 Visual Studio 2019 中从 aar 文件转换为 dll 文件时,出现类似错误。
error CS0534: 'SettingDeviceInfo.GetMoreEngineTask' does not implement inherited abstract member 'AsyncTask.DoInBackground(params Object[])'
error CS0534: 'SubscriptionActivity.GetSettingsTask' does not implement inherited abstract member 'AsyncTask.DoInBackground(params Object[])'
error CS0534: 'SubscriptionAdapter.DeActivateTask' does not implement inherited abstract member 'AsyncTask.DoInBackground(params Object[])'
我尝试安装 Xamarin.Build.AsyncTask NuGet 包,但无法安装,因为它与该框架不兼容。请帮我解决这个问题。 注意:我已经安装了该依赖项 NuGet 包,但显示相同的错误。
试试这个,将参数的managementType更改为params Java.Lang.Object [],并将方法的managedReturn更改为Java.Lang.Object。在您的库中 - Transforms - Metadata.xml
<attr path="/api/package[@name='package_name']/class[@name='name']/method[@name='method_name' and count(parameter)=1 and parameter[1][@type='parameter_type']]/parameter[1]" name="managedType">params Java.Lang.Object []</attr>
<attr path="/api/package[@name='package_name']/class[@name='name']/method[@name='method_name' and count(parameter)=1 and parameter[1][@type='parameter_type']]" name="managedReturn">Java.Lang.Object</attr>