简体   繁体   中英

Error: package android.support.v7.app does not exist [ANDROID STUDIO]

I'm trying to compile a project using Android Studio and this error show up. I've already imported the appcompat in the build.gradle file:

dependencies {
    compile 'com.android.support:support-v4:21.0.+'
    compile 'com.android.support:appcompat-v7:21.0.+'
    compile 'com.melnykov:floatingactionbutton:1.1.0'
}

and in several files I've imported this:

import android.support.v7.app.ActionBarActivity;

Remove this dependency from Gradle file and add from

Project(right click) -> Project Structure ->click on your application-> Dependencies -> Add button(right side) ->library dependency -> Choose V7 libary.

在此输入图像描述

Similarly add the module dependency using this way. Also before building the project make sure you do the same to the module project

运行gradle clean build命令

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM