Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Suggestion: use tools:overrideLibrary="android.support.v7.appcompat" to force usage

Tags:

android

am purchased app(beetle game) from internet to edit on it .. but when i run app this msg appears to me

    Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 1 cannot be smaller than version 9 declared in library /Users/omar/Downloads/BeetleGame1/app/build/intermediates/exploded-aar/com.google.android.gms/play-services/7.5.0/AndroidManifest.xml
    Suggestion: use tools:overrideLibrary="com.google.android.gms.all" to force usage

build.grade(project:beetlegame1)

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

build.grade(module:app)

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 19
    buildToolsVersion "23.0.0 rc2"

    defaultConfig {
        applicationId "com.game"
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_5
            targetCompatibility JavaVersion.VERSION_1_5
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:+'
}

build.grade(module:google-play-services-lib)

    configurations.create("default")
artifacts.add("default", file('google-play-services_lib.jar'))

i can attach the link to download app game which i have .. to see it :)

like image 497
omar hassan Avatar asked Jul 05 '15 02:07

omar hassan


3 Answers

The imported library google play services has a minsdk specified as 9 whereas you seem to be targeting much lower versions. To override it you need to add tools:overrideLibrary with the package name in AndroidManifest.xml file which will ignore the library specified minSDK version.

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="your package name">

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

tools:overrideLibrary marker

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.

like image 58
Psypher Avatar answered Oct 16 '22 14:10

Psypher


<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="22"
    tools:overrideLibrary="
    com.google.android.gms.all,
    com.google.android.gms.ads,
    com.google.android.gms.auth,
    com.google.android.gms.base,
    com.google.android.gms.measurement,
    com.google.android.gms,
    com.google.android.gms.analytics,
    com.google.android.gms.appindexing,
    com.google.android.gms.appinvite,
    com.google.android.gms.appstate,
    com.google.android.gms.cast,
    com.google.android.gms.drive,
    com.google.android.gms.fitness,
    com.google.android.gms.location,
    com.google.android.gms.maps,
    com.google.android.gms.games,
    com.google.android.gms.gcm,
    com.google.android.gms.identity,
    com.google.android.gms.nearby,
    com.google.android.gms.panorama,
    com.google.android.gms.plus,
    com.google.android.gms.safetynet,
    com.google.android.gms.wallet,
    com.google.android.gms.wearable" />
like image 27
Ahamadullah Saikat Avatar answered Oct 16 '22 16:10

Ahamadullah Saikat


You are getting this error because you do not declare a minSdkVersion in your app's build.gradle file:

 defaultConfig {
    applicationId "com.game"
    minSdkVersion 9
    targetSdkVersion 22
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_5
        targetCompatibility JavaVersion.VERSION_1_5
    }
}
like image 5
ianhanniballake Avatar answered Oct 16 '22 15:10

ianhanniballake