5

I want to use chrome custom tabs below api 16. My app suports Min SDK Version upto 10(GingerBread). When I declare the customtabs dependency in build.gradle

it gives the following error :

Error:Execution failed for task ':app:processDebugManifest'. Manifest merger failed : uses-sdk:minSdkVersion 10 cannot be smaller than version 15 declared in library [com.android.support:customtabs:23.0.1] Suggestion: use tools:overrideLibrary="android.support.customtabs" to force usage

How can I implement a mechanism to support devices using SDK below api 16 with default browser and above api 16 with customtabs.

2 Answers 2

9

tools:overrideLibrary marker (see here)

A special marker that can only be used with uses-sdk declaration to override importing a library which minimum SDK version is more recent than that application's minimum SDK version. Without such a marker, the manifest merger will fail. The marker will allow users to select which libraries can be imported ignoring the minimum SDK version.

Example, In the main android manifest :

<uses-sdk android:targetSdkVersion="14" android:minSdkVersion="2" tools:overrideLibrary="com.example.lib1, com.example.lib2"/> 

will allow the library with the following manifest to be imported without error :

<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.lib1"> <uses-sdk android:minSdkVersion="4" /> </manifest> 
Sign up to request clarification or add additional context in comments.

2 Comments

the pakcage name for chrome custom tabs is: android.support.customtabs
related th sdk version in your question, when your app run on devices with android version from 10 to 15 it will crash ... you must check at runtime as suggested from andreban
4

As mentioned in the error, you can override the minSdk version from the library by using the tools:overrideLibrary marker.

Be sure to check SDK_INT > ICE_CREAM_SANDWICH_MR1 on your code before making calls to the Library to avoid exceptions at runtime.

When using a system that does not support Custom Tabs, just fire a normal ACTION_VIEW intent.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.