Unexpected element <uses-library> when releasing

For some time now I cannot release anymore the Android version of my app. Using latest stable versions of everything, targeting Android 9.0 but when I build, it fails with:

unexpected element <uses-library> found in <manifest>. (APT0000)

My AndroidManifest.xml keeps getting extended with

<uses-library android:name="com.google.android.maps" />

although I'm not using any Google Maps in my app. Must be related to some other dependency but there so many of them when it comes to an Android app, that's hard to keep track of why everything is needed.

Any idea for this build error?

Best Answer

  • XavierPerseguersXavierPerseguers CH ✭✭✭
    Accepted Answer

    Strange, I tried to manually remove again that offending line from AndroidManifest.xml and this time it did not get added back while building.

Answers

  • albertoha94albertoha94 Member ✭✭
    edited October 11

    @XavierPerseguers
    Have you checked if a NUGET package requires something related to maps?
    Maybe that package is adding the reference.

  • XavierPerseguersXavierPerseguers CHMember ✭✭✭

    @albertoha94 Yes, for sure, but have a look at this mess:

    None of these references are actually required by me, but they are there for some reason for Xamarin.Forms and alike. That's really unfortunate, will have to investigate but for Xamarin.iOS I have +/- only what I actually need as 3rd-party components. for Xamarin.Android I have a bunch of such packages which I have no idea what they really do.

  • XavierPerseguersXavierPerseguers CHMember ✭✭✭
    edited October 14

    I created a graph of dependencies for those Xamarin.Android libraries:

    This helped me removing 3 useless dependencies:

    • Xamarin.Android.Support.Exif
    • Xamarin.Android.Support.v7.MediaRouter
    • Xamarin.Android.Support.v7.Palette

    However the problem remains!

  • XavierPerseguersXavierPerseguers CHMember ✭✭✭
    Accepted Answer

    Strange, I tried to manually remove again that offending line from AndroidManifest.xml and this time it did not get added back while building.

  • albertoha94albertoha94 Member ✭✭

    Sweet!

Sign In or Register to comment.