构建 xamarin android 项目失败,错误 XA4212 [英] Build xamarin android project unsucessfully,error XA4212

查看:14
本文介绍了构建 xamarin android 项目失败,错误 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆