1

Here is my build.gradle file:

// 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.0.0'

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

allprojects {
    repositories {
        jcenter()
    }
}

I am trying to run a sample app but when I click on run I am getting errors:

/home/admin/AndroidStudioProjects/MyApplication/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res/values-v14/values.xml
Error:(6, 21) No resource found that matches the given name: attr 'android:actionModeCopyDrawable'.
Error:(5, 21) No resource found that matches the given name: attr 'android:actionModeCutDrawable'.
Error:(7, 21) No resource found that matches the given name: attr 'android:actionModePasteDrawable'.
Error:(8, 21) No resource found that matches the given name: attr 'android:actionModeSelectAllDrawable'.
/home/admin/AndroidStudioProjects/MyApplication/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.3/res/values-v11/values.xml

similarly 175 total errors. Why I am getting this error. How to resolve it?

I followed this but since my build.gradle does't include android so I can't follow the steps.

Community
  • 1
  • 1
anonghost
  • 17
  • 8
  • 1
    There are two `build.gradle` files in your project. The `android` closure will be in the `build.gradle` file in your `app` module's directory. Usually, that is the `build.gradle` file that we worry about as developers. – CommonsWare Jan 03 '15 at 14:54
  • @CommonsWare thanks a ton. it solved the issue (Maybe You should add this as an answer so that I can close the question) – anonghost Jan 03 '15 at 15:05

2 Answers2

0

A native Android Studio project will put your application code in an app module (a.k.a., sub-project). To make that work, there are two build.gradle files:

  • The one in the project root directory, which contains the sort of thing you see in the question. You will need to modify this file when you want to upgrade your Gradle for Android plugin (com.android.tools.build:gradle:1.0.0) to a newer version. If you elect to add other modules, you can use this top-level build.gradle file for setting up things that are in common across all your modules.

  • The one in the app module directory, which contains the configuration details for building that specific module. For simple one-module Android Studio projects, most of your build.gradle work will be in this build.gradle file, not the top-level one.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
0

As CommonsWare commented in a reply above, there are two build.gradle files:

./build.gradle
./app/build.gradle --> this is the correct one
Cequiel
  • 3,505
  • 6
  • 27
  • 44