这在Android中意味着什么

我正在使用
Android Studio 1.0.2,我在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()
    }
}

如果我不在AndroidManifest.xml中写这个,Android Studio会给我一个错误.

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

早期Android Studio的最新版本之前.我必须写这个

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

究竟是什么< uses-sdk工具:node =“replace”/>和< uses-sdk工具:overrideLibrary =“com.google.android.gms”/>.

最佳答案 根据
http://tools.android.com/tech-docs/new-build-system/user-guide/manifest-merger

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.

并根据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 turned on a new Manifest Merger by default, and it allows us to do some nifty stuff (read more about it here). In the manifest above, I’d included a uses-sdk node that simply specifies a tools:node attribute. This specific configuration tells the manifest processor to replace any attributes from uses-sdk nodes in lower-priority manifests (such as library manifests) with the attributes in the uses-sdk node with the tools:node=”replace” attribute. Since Gradle also inserts minSdkVersion and targetSdkVersion from your build.gradle into this uses-sdk node, that’s all we really need to add.
Now you should be able to run your application on any device supported by your minSdkVersion, while taking advantage of the neat new views and utilities in the support lib!

点赞