in Android I am using Android Studio 1.0.2 where I have belo...">

What does it mean <uses-sdk tools: overrideLibrary = "com.google.android.gms" / "> in Android

I am using Android Studio 1.0.2 where I have below build.gradle.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

      

Android Studio gives me an error if I don't write this in AndroidManifest.xml

.

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

      

Earlier before the latest version of Android Studio. I have to write this

<uses-sdk tools:node="replace" />

      

What exactly is this for <uses-sdk tools:node="replace" />

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

.

+3


source to share


1 answer


according to http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger

Tools: overrideLibrary marker

A special token that can only be used with the uses-sdk declaration to override the import of a library whose minimum SDK version is later than the SDK version for this application. Without such a marker, a manifest merge will fail. The marker will allow users to choose which libraries to import, ignoring the minimum SDK version.



and according to http://www.reddit.com/r/androiddev/comments/297xli/howto_use_the_v21_support_libs_on_older_ve

Version 0.11 of the Android Gradle plugin has added a new manifest merge by default and it allows us to do some great things (more on that here). In the manifests above, I've included the use-sdk node, which just specifies the attributes: node. This particular config tells the manifest processor to replace any attributes from the uses-sdk nodes in the lower priority manifest (like library manifests) with the attributes in the use-sdk node using the tools: node = "replace", Because Gradle also inserts minSdkVersion and targetSdkVersion from your build.gradle to this use-sdk node, all we really need to add. Now you can run the application on any device supported by your mini-server using the handy new views and utilities in lib!

+2


source







All Articles