Manifest merger failed解决方法

集成PullToRefresh报以下错误:

1.Error:Execution failed for task ':pullToRefreshListFragment:processDebugAndroidTestManifest'.

> java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 4 declared in library [BeijingNews:library:unspecified] D:\android_studio_project\BeijingNews\pullToRefreshListFragment\build\intermediates\exploded-aar\BeijingNews\library\unspecified\AndroidManifest.xml

    Suggestion: use tools:overrideLibrary="com.handmark.pulltorefresh.library" to force usage


2.分析:问题是“pullToRefreshListFragment”这个库的build.gradle默认的

defaultConfig {
    
}
为空,和 library中的build.gradle中
defaultConfig {
    minSdkVersion 4
    targetSdkVersion 4
}

不一样,所以出现uses-sdk:minSdkVersion 1 cannot be smaller than version 4 declared in library [BeijingNews:library:unspecified]。

3.解决办法

方法①“pullToRefreshListFragment”这个库的build.gradle默认的空设置为library中的build.gradle一样的设置。

方法②在合并时,出问题的库pullToRefreshListFragment的AndroidManifest的下加入:

<uses-sdk tools:overrideLibrary="com.handmark.pulltorefresh.library"/>
















你可能感兴趣的:(Android开发)