未能成功构建Xamarin Android项目,错误XA4212 [英] Build xamarin android project unsucessfully,error XA4212
问题描述
在Visual Studio 2017 15.4上,一切都很好.但是当我升级到15.5之后,我的xamarin android项目无法成功构建,显示:
At visual Studio 2017 15.4,everything goes fine.But after I upgrated to 15.5,my xamarin android project can not be built successfully,showing:
error XA4212: Type `Android.Support.V4.App.JobIntentService/JobServiceEngineImpl` implements `Android.Runtime.IJavaObject` but does not inherit `Java.Lang.Object` or `Java.Lang.Throwable`. This is not supported.
推荐答案
在@Ironman答案之后,这发生在Xamarin.Android 8.0中,因此我在项目.csproj文件中将该属性设置为 false 在下一节中.
Following @Ironman answer, this happens with Xamarin.Android 8.0, so I set the property to false in the project .csproj file in the following section.
<PropertyGroup>
<!-- Other properties -->
<AndroidErrorOnCustomJavaObject>false</AndroidErrorOnCustomJavaObject>
</PropertyGroup>
在大多数情况下,您应该添加属性,因为默认情况下该属性不存在.
In most cases you should add the property as it doesn't exist by default.
现在,仅在出现警告的情况下,您才能正常构建和运行该应用程序.
Now you can build and run the app normally, only with a warning.
请注意.csproj文件中的其他 PropertyGroup 标记,这些标记特定于构建条件.
Beware that are other PropertyGroup tags inside the .csproj file, that are specific to build conditions.
您可以在 https:中查看其他构建属性和配置://github.com/xamarin/xamarin-android/blob/master/Documentation/build_process.md
这篇关于未能成功构建Xamarin Android项目,错误XA4212的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!