我在哪里将android支持库v7添加到build.gradle?

时间:2013-12-18 11:38:07

标签: android android-actionbar android-support-library

我正在尝试在Android 2.2中使用操作栏,但我无法在我的项目中找到 build.gradle ?请有人帮帮我吗?

链接在这里:http://developer.android.com/tools/support-library/setup.html

Make sure you have downloaded the Android Support Repository using the SDK Manager.
**Open the build.gradle file for your application.**
Add the support library feature project identifier to the dependencies section. For example, to include the appcompat project add compile "com.android.support:appcompat-v7:18.0.+" to the dependencies section, as shown in the following example:
dependencies {
    ...
    compile "com.android.support:appcompat-v7:18.0.+"
}

1 个答案:

答案 0 :(得分:0)

在Android Studio中,您可以搜索文件。因此,在Windows中尝试ctrl + shift + n或在Mac中尝试cmd + shift + o。然后输入build.gradle,该文件将显示在搜索结果中。查找块dependencies并在那里添加支持库,如此

 dependencies {
     ...
     compile 'com.android.support:support-v4:19.0.0'
 }

如果您想了解有关gradle的更多信息,请查看Android documentation