htafoya
htafoya

Reputation: 19283

Android Studio Gradle - Failed to resolve dependency : acra

I am willing to add Acra to my android studio project.

However, although tutorial looks pretty simple , I am unable to get the dependency, and I get the error:

Failed to resolve: ch.acra:acra:4.8.5

Grade File:

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
        classpath 'com.google.gms:google-services:1.5.0'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.android.support:support-v4:21.+'
    compile 'ch.acra:acra:4.8.5'
    compile 'com.google.android.gms:play-services-location:8.3.0'
    compile ('com.google.android.gms:play-services-analytics:8.3.0') {
        exclude module: 'support-v4'
    }

}

What am I missing?

I also get this in terminal:

* What went wrong:
A problem occurred configuring root project 'WifiCapture'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
   > Could not find ch.acra:acra:4.8.5.
     Searched in the following locations:
         file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.pom
         file:/Users/myuser/Library/Android/sdk/extras/android/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.jar
         file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.pom
         file:/Users/myuser/Library/Android/sdk/extras/google/m2repository/ch/acra/acra/4.8.5/acra-4.8.5.jar
     Required by:
         :MyApp:unspecified

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Upvotes: 1

Views: 1563

Answers (3)

F43nd1r
F43nd1r

Reputation: 7759

This is probably a connection issue. Try to force gradle to redownload all dependencies. If that doesn't work, check firewall etc.

Upvotes: 1

htafoya
htafoya

Reputation: 19283

The problem was that repositories block should be outside the buildscript block

Upvotes: 2

Avinash4551
Avinash4551

Reputation: 230

Can you try using this : compile 'ch.acra:acra:4.9.0-RC-2'

Upvotes: 0

Related Questions