Android Studio doesn't find com.android.support:support-v4:19.1.0

核能气质少年 提交于 2019-12-04 09:10:45

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

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.

From the SDK Manager, delete and re-install the Android Support Library 19.1 package.

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.

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

xXJJJasonMokXx

Right clicking on the library and select the import as library option from the context menu works for me.

Max

Try to go

Project Structure -> Dependencies -> Add : then select -> File dependecies

then select the proper library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!