Android studio importing problem into gradle

I am new to Android Studio and just tried to import an eclipse project. I have been trying to solve this problem for quite some time, but I can’t. I have a mainactivity project that uses mmany other staggeredgridview, devsmart, google maps and appcompactv7 libraries. I get the following 2 errors.

Note. The mainactivity project is the one I'm working on and uses other external libraries.

Error:(7, 5) uses-sdk:minSdkVersion 8 cannot be smaller than version 9 declared in library B:\Android Studio Projects\mainActivity\build\intermediates\exploded-aar\com.google.android.gms\play-services\6.5.87\AndroidManifest.xml Suggestion: use tools:overrideLibrary="com.google.android.gms" to force usage :mainActivity:processDebugManifest FAILED Error:Execution failed for task ':mainActivity:processDebugManifest'. Manifest merger failed with multiple errors, see logs 

build.gradle mainactivity

 apply plugin: 'com.android.application' android { compileSdkVersion 17 buildToolsVersion "21.1.2" defaultConfig { applicationId "com.example.staggeredgridviewdemo" minSdkVersion 8 targetSdkVersion 16 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile project(':devsmartAndroid') compile project(':staggeredGridViewmaster') compile 'com.google.guava:guava:16.0.1' compile 'com.google.android.gms:play-services:+' compile 'com.android.support:appcompat-v7:19.1.0' compile files('libs/commons-codec-1.6.jar') } 

build.grade for devsmart

 apply plugin: 'com.android.library' android { compileSdkVersion 14 buildToolsVersion "21.1.2" defaultConfig { minSdkVersion 4 targetSdkVersion 4 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile files('libs/CWAC-SackOfViewsAdapter.jar') compile('com.android.support:appcompat-v7:19.1.0') { // really use 19.1.0 even if something else resolves higher force = true } } 

build.gradle for sttageredgridview

 apply plugin: 'com.android.library' android { compileSdkVersion 17 buildToolsVersion "21.1.2" defaultConfig { minSdkVersion 8 targetSdkVersion 16 } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile('com.android.support:appcompat-v7:19.1.0') { // really use 19.1.0 even if something else resolves higher force = true } } 
+6
source share
3 answers

Just edit the minsdk your build.gradle mainactivity to 9 :

 defaultConfig { applicationId "com.example.staggeredgridviewdemo" minSdkVersion 9 // changed line targetSdkVersion 16 } 

Note. Also did the same for other libs if minsdk is small and then 9

+7
source

Please open the manifest file and write the following code that will work

 <uses-sdk tools:overrideLibrary="com.google.android.gms"/> 

and add a list of libraries for uses-skd, separated by commas

+1
source

Go to all manifest files or build.gradle files of all projects and make minSDKversions the same.

0
source

Source: https://habr.com/ru/post/980370/


All Articles