Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding support library to android studio project

I am trying to add v7 support for action bars to my project and followed the steps on the android dev site but still doesn't work...

In my gradle file I have

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

repositories {
    mavenCentral()
}

dependencies {
    compile 'com.android.support:support-v4:13.0.+'
    compile "com.android.support:appcompat-v7:18.0.+"
}

android {
    compileSdkVersion 17
    buildToolsVersion "17.0.0"

    defaultConfig {
        minSdkVersion 7
        targetSdkVersion 16
    }
}

just like it says to do but when I try to import the class or use the resource, it isn't found.

I also downloaded the latest support library and repository in the sdk manager as well.

Am I missing a step or setting?

like image 929
Shane Avatar asked Nov 13 '22 00:11

Shane


1 Answers

I fixed it.... All I needed to do was run

./gradlew clean build

in the root of my project. Android studio wasn't updating the gradle so it didn't include the external libraries.

like image 145
Shane Avatar answered Nov 14 '22 22:11

Shane