Xamarin android v7 and v13 support library in the same application

Until today, I have used the v13 support library in my application. Now I also need to use the v7 support library.

I added them to my application, but I have some problems.

  • At the first compilation, I got a lot of errors regarding resources not found. I solved this by setting the api level to 15 and minus to 8. This was suggested on stackoverflow. Can someone explain why this is necessary?

    2. Now I get some errors talking about Duplicate managed type found! Mappings between managed types and Java types must be unique. First type: 'Android.Support.V4.Content.Loader / IOnLoadCompleteListenerImplementor, Xamarin.Android.Support.v13, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null'; Second type: "Android.Support.V4.Content.Loader / IOnLoadCompleteListenerImplementor, Xamarin.Android.Support.v4, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null '.

    I assume this is due to the fact that v13 allready has some types from v4, and v7 refers to v4. Any idea?

+6
source share
1 answer

From http://developer.android.com/tools/support-library/features.html :

Support Library v4:

This library is intended for use with Android 1.6 (API level 4) and higher. It includes the largest set of APIs compared to other libraries, including application component support, user interface functions, accessibility, data processing, network connectivity, and software utilities. Here are a few key classes included in the v4 library:

v7 Library support:

There are several libraries designed for use with Android 2.1 (API level 7) and higher. These libraries provide specific feature sets and can be included in your application independently.

V8 Support Library:

This library is intended for use with Android (API level 8) and higher. It adds support for the RenderScript calculation structure. These APIs are included in the android.support.v8.renderscript package. You should be aware that the steps to include these APIs in your application are very different from other support library APIs. For more information about using these APIs in an application, see the RenderScript Developer's Guide.

Support Library v13:

This library is designed for Android 3.2 (API level 13) and higher. It adds support for the Fragment user interface template with a class (FragmentCompat) and additional fragment support classes. For more information about fragments, see the Fragments Developer's Guide. For more information about the v13 support library APIs, see the android.support.v13 package in the API Help.

If you look at your mistake, you have two conflicting conflicts because you imported both v4 and v13. You can see how they have similar classes:

http://developer.android.com/reference/android/support/v4/app/package-summary.html http://developer.android.com/reference/android/support/v13/app/package-summary.html

You should use v4 for min-sdk = 4-12 and v13 for min-sdk = 13 +

Even though you can use v13 in lower versions of the Android API, your apps will break into anything and 12 APIs. You should be able to use v7 and v13 just fine, until you conflict with v4.

EDIT: Here's a video explaining the Android support libraries that recently appeared http://xamarin.wistia.com/medias/guqtgpdqms

Source code: https://github.com/jamesmontemagno/Xamarin.Android-AppCompat

Source: Xamarin

+4
source

All Articles