0

build.gradle has
minSdkVersion 8

I am trying to compile fresco which required minimumsdk 9 compile 'com.facebook.fresco:fresco:0.9.0+'

I get a sync error

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library ...
    Suggestion: use tools:overrideLibrary="com.facebook.drawee.backends.pipeline" to force usage

I have tried adding it to the manifest override list and required false as shown below but get the same error.

<uses-sdk tools:overrideLibrary="com.facebook"/>
 <uses-library android:name="com.facebook" android:required="false"/>

If i add the full path e.g. com.facebook.drawee.backends.pipeline then the build just fails on another sub path. I only intend to use fresco programatically on compatible devices and will not use it if device sdk is < 9 so how do i ignore it in the build validation

DeveloperDH
  • 443
  • 5
  • 16

1 Answers1

0

If you're using android studio, open the Build.gradle(Module: app) file and set the minSdkVersion to 9 there.

EDIT Wherever you are trying to access the methods, first wrap in an API level check...

if(Build.VERSION.SDK_INT >= 9) {
    //Do your thing....    
}

To prevent the compiler from compaining, wherever you do this check, insert the following above the method decleration...

TargetApi(9)

for example...

TargetApi(9)
public void myFunction() {
    if(Build.VERSION.SDK_INT >= 9) {
        //Do you thing...
    }    
}
Terry W
  • 203
  • 3
  • 9