Gradle Build Android Project “Could not resolve all dependencies” error

后端 未结 12 1996
孤街浪徒
孤街浪徒 2020-12-07 18:00

I\'m trying to build my first project with Gradle and I think my gradle files and settings are correct.

I\'m using only one module and Support V4 + AppCompatBar libr

相关标签:
12条回答
  • 2020-12-07 18:50

    As Peter says, they won't be in Maven Central

    from the Android SDK Manager download the 'Android Support Repository' and a Maven repo of the support libraries will be downloaded to your Android SDK directory (see 'extras' folder)

    to deploy the libraries to your local .m2 repository you can use maven-android-sdk-deployer

    2017 edit:

    you can now reference the Google online M2 repo

    repositories {
    google()
    jcenter()
    }
    
    0 讨论(0)
  • 2020-12-07 18:50
    compileSdkVersion 17
    targetSdkVersion 17
    

    change the compile version from 18 to 17

    compile "com.android.support:support-v4:17.0.+"
    compile "com.android.support:appcompat-v7:17.0.+"
    
    0 讨论(0)
  • 2020-12-07 18:51

    Add this to your gradle:

    allprojects {
        buildscript {
            repositories {
                maven {
                    url "https://dl.bintray.com/android/android-tools"
                }
            }
        }
    ...
    }
    
    0 讨论(0)
  • 2020-12-07 18:54

    I had this message in Android Studio 2.1.1 in the Gradle Build tab. I installed a lot of files from the SDK Manager but it did not help.

    I needed to click the next tab "Gradle Sync". There was a link "Install Repository and sync project" which installed the "Android Support Repository".

    0 讨论(0)
  • 2020-12-07 18:57

    Try to turn off your firewall, it works for me. It seems that android studio wants to download some dependencies and our firewall prevents it from downloading it, just be aware that turning your firewall off may lower the security of your computer. If you have more time you can manually allow your android studio to bypass your firewall, this way you can turn on your firewall while allowing android studio to download anything that it wants.

    0 讨论(0)
  • 2020-12-07 19:04
    1. Install android sdk manager
    2. check if building tools installed. install api 23.
    3. from the Android SDK Manager download the 'Android Support Repository'
    4. remove cordova-plugin-android-support-v4
    5. build
    0 讨论(0)
提交回复
热议问题