Friday, 8 January 2021

Xamarin.Android with MapBox: Compilation failed with XA4212

I have a Xamarin.Android project and want to use MapBox for navigation. They do not provide a SDK for Xamarin, so I use the Naxam Bindings. (GitHub: https://github.com/NAXAM/mapboxnavigationui-android-binding)

When I compile a test code copied from their demo code, I run into the following error: XA4212: Type Com.Mapbox.Services.Android.Location.LostLocationEngine implements Android.Runtime.IJavaObject but does not inherit Java.Lang.Object or Java.Lang.Throwable. This is not supported.

By researching I found out that this error can be changed to a warning by putting the following in my project file:

<PropertyGroup> <AndroidErrorOnCustomJavaObject>false</AndroidErrorOnCustomJavaObject> </PropertyGroup>

But if I do that, the compilation fails with: "'java.exe' exited with code 1".

the build log shows: Type com.google.gson.annotations.JsonAdapter is defined multiple times: obj\Debug\90\lp\1\jl\gson.jar:com/google/gson/annotations/JsonAdapter.class, obj\Debug\90\lp\2\jl\gson-2.8.0.jar:com/google/gson/annotations/JsonAdapter.class

I also filed an issue to Naxam which you can find here: https://github.com/NAXAM/mapboxnavigationui-android-binding/issues/12

I tried to compile their project myself, but it can't resolve the dependencies, so it doesn't compile either.

Is there anything I can do futher or has anyone an idea?

Thanks for any help in advance :)



from Xamarin.Android with MapBox: Compilation failed with XA4212

No comments:

Post a Comment