Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
810 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 Reply

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...