uses-sdk element cannot have a “tools:node” attribute

后端 未结 5 1128
滥情空心
滥情空心 2020-12-28 16:26

I\'ve updated Android Studio last night to 0.9.0, buildToolsVersion to 21.1.0 and gradle to 0.14.0, after that I\'m receiving this error

Error:Executi

相关标签:
5条回答
  • 2020-12-28 16:41

    OK this is not the answer, but a temporary workaround.

    According to the Gradle build tools release notes this problem was fixed in version 0.13.2 (2014/09/26)
    However, seems to happen again in 0.14.0 (2014/10/31)

    You can disable the manifest merger task in order to build your project for the time being.
    Add the following in your build.gradle file

    android.applicationVariants.all { variant ->
    variant.processResources.manifestFile = file('src/main/AndroidManifest.xml')
    variant.processManifest.enabled=false }
    

    See this question for reference.

    0 讨论(0)
  • 2020-12-28 16:43

    Solution:--

    Add this line to uses-sdk tag like this:-

    <uses-sdk
        tools:node="merge"   <----This line do the magic
        android:minSdkVersion="14"
        android:targetSdkVersion="19" />
    

    And add the tools name space in manifest :-

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools" .....
    .../>
    
    0 讨论(0)
  • 2020-12-28 16:44

    The problem has solved after updating the AS to v0.9.1 and Gradle to 0.14.1.

    Thank you guys_

    Update

    The problem appears again!

    Update 2

    Here is a workaround to solve this problem:

    1. Open your project with Android Studio 0.8.14 / Gradle build tools 0.13.2
    2. Build your project.
    3. Switch back to Android Studio 0.9.1 / Gradle build tools 0.14.1
    4. gradlew assembleRelease will work now
    0 讨论(0)
  • 2020-12-28 16:46

    My solution

    • I have removed all of the <uses-sdk tools:node="replace" /> From all of my manifest.xml files
    • In my base.gradle file(the one for the entire project I Added

      ext {
        compileSdkVersion = 19
        buildToolsVersion = "21"
        minSdkVersion = 10
        targetSdkVersion = 19
      }
      
    • In my modules I have this

      // all modules
      compileSdkVersion rootProject.ext.compileSdkVersion
      buildToolsVersion rootProject.ext.buildToolsVersion
      // in an application module
      defaultConfig {
         applicationId "com.something"
         minSdkVersion rootProject.ext.minSdkVersion
         targetSdkVersion rootProject.ext.targetSdkVersion
         versionCode appVersionCode
         versionName appVersionName
      }
      
    0 讨论(0)
  • 2020-12-28 16:52

    I ran into this after upgrading to Android Studio 1.0.0 rc4. I had previously been using so that I could make projects with lower min SDK versions than some of the libraries they depended on. Turns out, if you remove tools:replace and let the compiler error out again with the manifest merge conflict, it will provide you with a much better solution:

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

    At least, the Google Play Services library was what I was running into. Actually, you can list a whole bunch if you need to. Just comma-separate the package names. You may have to run the compiler a few times until it tells you every library that's causing problems.

    0 讨论(0)
提交回复
热议问题