问题
I have imported one project into Android Studio
but I got the error:
Could not find com.android.support:support-v4:19.1.0.
Where could I find this file? I have imported the project using Gradle
.
I have the Android Studio version 0.5.7
the last android sdk and java 1.7u55
.
回答1:
Just add this code to you build.gradle file
dependencies {
compile 'com.android.support:support-v4:19.+'
}
and press Tools -> Android -> Sync Project with Gradle Files
Gradle will download necessary files by himself
回答2:
It does not work for me either. It works with 19.0.1 But if (I use gradle) I do this in my build.gradle:
repositories {
def androidHome = System.getenv("ANDROID_HOME")
mavenCentral()
maven {
url "$androidHome/extras/android/m2repository/"
}
}
It finds the artifact.
回答3:
From the SDK Manager, delete and re-install the Android Support Library 19.1 package.
回答4:
I had this same problem with morning. I found the Jar file that I needed in /<MySdkFolder>/extras/android/support/
- in there are some sub folders with the different support libraries in them, so the last part of the path depends on which one that you want to use.
I just copied this into the lib folder of the project. I'm sure there is a more technical solution but it worked for me.
回答5:
Following theory works at me:
Android Studio has problems importing support-v4:19.1.+ library when it comes through a transitive dependency.
Solution Adding support-v4 as own dependency and exclude this lib where it comes transitive. then i could not more see this import issue
回答6:
Right clicking on the library and select the import as library option from the context menu works for me.
回答7:
Try to go
Project Structure -> Dependencies -> Add : then select -> File dependecies
then select the proper library
来源:https://stackoverflow.com/questions/23386545/android-studio-doesnt-find-com-android-supportsupport-v419-1-0