1

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.
htafoya
  • 18,261
  • 11
  • 80
  • 104

3 Answers3

2

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

htafoya
  • 18,261
  • 11
  • 80
  • 104
1

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

F43nd1r
  • 7,690
  • 3
  • 24
  • 62
0

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

Avinash4551
  • 220
  • 1
  • 9