Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Build xamarin android project unsucessfully,error XA4212

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.
like image 447
Liu Feng Avatar asked Dec 09 '17 11:12

Liu Feng


1 Answers

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.

Beware that are other PropertyGroup tags inside the .csproj file, that are specific to build conditions.

You can see the other build properties and configurations in https://github.com/xamarin/xamarin-android/blob/master/Documentation/build_process.md

like image 169
Carlos487 Avatar answered Nov 01 '22 17:11

Carlos487