Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
245 views
in Technique[技术] by (71.8m points)

android studio - Could not resolve all dependencies for configuration ':sample:_debugCompile'

I know this was asked a few times but the solutions did not really help. I want to import the 'sample' project from https://github.com/zsoltk/overpasser into android studio and I get the following error:

A problem occurred configuring project ':sample'.
> Could not resolve all dependencies for configuration ':sample:_debugCompile'.
   > Could not find com.android.support:multidex:1.0.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.pom
         https://jcenter.bintray.com/com/android/support/multidex/1.0.1/multidex-1.0.1.jar
     Required by:
         overpasser3:sample:unspecified
   > Could not find com.android.support:appcompat-v7:23.4.0.
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0.pom
         https://jcenter.bintray.com/com/android/support/appcompat-v7/23.4.0/appcompat-v7-23.4.0.jar
     Required by:
         overpasser3:sample:unspecified
   > Could not find com.google.android.gms:play-services-location:9.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/android/gms/play-services-location/9.2.1/play-services-location-9.2.1.pom
         https://jcenter.bintray.com/com/google/android/gms/play-services-location/9.2.1/play-services-location-9.2.1.jar
     Required by:
         overpasser3:sample:unspecified
   > Could not find com.google.android.gms:play-services-maps:9.2.1.
     Searched in the following locations:
         https://jcenter.bintray.com/com/google/android/gms/play-services-maps/9.2.1/play-services-maps-9.2.1.pom
         https://jcenter.bintray.com/com/google/android/gms/play-services-maps/9.2.1/play-services-maps-9.2.1.jar
     Required by:
         overpasser3:sample:unspecified

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

The web links android studio gives me here are redirecting me into another link which is total empty beside this:

{
  "errors" : [ {
    "status" : 404,
    "message" : "Could not find resource"
  } ]
}

The build.gradle:

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath "com.android.tools.build:gradle:2.1.2"
        classpath "com.neenbedankt.gradle.plugins:android-apt:1.8"
        classpath 'com.jakewharton.hugo:hugo-plugin:1.2.1'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
apply plugin: 'com.jakewharton.hugo'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "hu.supercluster.overpasser"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    signingConfigs {
        debug {
            storeFile file("overpasser-sample.jks")
            storePassword "sample"
            keyAlias "sample"
            keyPassword "sample"
        }
    }

    buildTypes {
        debug {
        }
    }
}

dependencies {
    apt "org.androidannotations:androidannotations:3.3.2"
    compile "org.androidannotations:androidannotations-api:3.3.2"

    // ---------

    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.google.android.gms:play-services-location:9.2.1'
    compile 'com.google.android.gms:play-services-maps:9.2.1'

    // ---------

    compile project(':library')
    compile project(':library-retrofit-adapter')
}

apt {
    arguments {
        androidManifestFile variant.outputs[0].processResources.manifestFile
        resourcePackageName 'hu.supercluster.overpasser'
    }
}
question from:https://stackoverflow.com/questions/65932939/could-not-resolve-all-dependencies-for-configuration-sample-debugcompile

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try this

    repositories {
            mavenCentral()
    jcenter()
google()
    
        }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...