Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
808 views
in Technique[技术] by (71.8m points)

xamarin.android - 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.
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...