0

I tried to add the support library v4 in a project with android studio, I read how to add the support library Add support library to Android Studio project

but the tab dependencies not appear. I click on the (only) module of my project, but do not appear. I tried with a blank project nothing appear.

EDIT

Project structure dialog

Project structure dialog

project

Project view

EDIT 2 The build.grade file as generated by Android Studio

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.6.+'
    }
}
apply plugin: 'android'

repositories {
    mavenCentral()
}

android {
    compileSdkVersion 16
    buildToolsVersion "19.0.1"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 19
    }
}

dependencies {

}
Cœur
  • 37,241
  • 25
  • 195
  • 267
  • Please attach a screenshot of your project view and also your project structure dialog. – Scott Barta Jan 04 '14 at 15:44
  • I can't add image (less then 10 reputation point), I post the two link to the screenshot :-) – user2553778 Jan 04 '14 at 16:00
  • Hmm, it's some sort of bug in that dialog, but I'm not sure what. You're running Android Studio 0.4.0? (If not, please upgrade.) Is this just a plain project that was generated with the New Project wizard, or did you get it somewhere else? Did you edit the `build.gradle` file by hand? Does it complain of anything other than missing classes from v4-support when you compile? – Scott Barta Jan 04 '14 at 17:44
  • I tried with Android 0.3.2 ("stable" version) and Android 0.4.0 also. This is the project created by the wizard in Android studio (I modify no files), but it happens also in others projects. No, I don't edit the file build.gradle. Later I edit that file follow the instructions found at: http://developer.android.com/tools/support-library/setup.html It works, but I don't like to edit the build file :-) It's missing also support library-v7. I check Android SDK manager, I download all the necessary files. – user2553778 Jan 04 '14 at 18:39
  • please post the your build.gradle file to check dependencies. – Piyush Agarwal Jan 04 '14 at 20:06
  • I add it :-) It's the self-generate build.gradle file – user2553778 Jan 05 '14 at 11:10

1 Answers1

1

First I recommend you to upgrade the AS to 0.4.0, lot of bugs are fixed in this.

Then check for the dependencies in build.gradle of your MyApplication module for support library.

 dependencies {

    compile 'com.android.support:support-v4:18.0.+'

 }

If not added add the mentioned dependency. After adding the line sync project with Gradle Files using the option available in toolbar.

enter image description here

Make sure you are not getting any error. If sync happens successfully check the Module again.

You should see screen like this, In my case support v7 also added, you can ignore that.

Dependencies in Module Settings

Piyush Agarwal
  • 25,608
  • 8
  • 98
  • 111
  • Hi, Thanks for the reply :-) As I said in a previous comment I can add the library via edit the build.gradle, but I want understand why a specific tab (dependecies) not appear :-) Is it a bug as Scott Barta suggest? – user2553778 Jan 05 '14 at 11:03
  • Which version of studio you are using currently. The build.gradle file you have posted is missing dependencies. Have you tried adding the line in dependencies and synced your project ? There is no such bug in Android Studio 0.4.0, I not sure about 0.3.2. – Piyush Agarwal Jan 05 '14 at 18:32