Search code examples
gradleandroid-gradle-pluginbuild.gradlecrashlyticscrashlytics-android

Issues when Integrating Crashlytics in Android Studio


I'm Getting this Error when I try to integrate Crashlytics with my Project. I used the Crashlytics plugin to generate the code . But when I do a sync in Gradle it gives e the following error. I have also attavhed the build.gradle

Error:Unable to find method 'org.apache.http.conn.ssl.SSLConnectionSocketFactory.(Ljavax/net/ssl/SSLContext;Ljavax/net/ssl/HostnameVerifier;)V'. Possible causes for this unexpected error include:

  • Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)
  • The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem. Stop Gradle build processes (requires restart)
  • Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I have tried Invalidating the cache and also Redownload dependencies and also stoping the Gradle build and starting it.

I'm also connected to the Internet.

The Build works fine if I remove the crashlytics dependency.

Can anyone tell e how to fix this.

build.gradle

buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.2'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    mavenCentral()
    maven { url 'https://maven.fabric.io/public' }
}

android {
    compileSdkVersion 23
    buildToolsVersion "22.0.1"

    defaultConfig {
        minSdkVersion 16
        targetSdkVersion 22
    }
}

dependencies {
    compile 'com.android.support:support-v4:23.0.0'
    compile 'com.android.support:support-v13:23.0.0'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:palette-v7:23.0.0'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:cardview-v7:23.0.0'
    compile 'com.squareup.okhttp3:okhttp:3.1.2'
    compile files('libs/volley.jar')
    compile('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
        transitive = true;
    }
}

Solution

  • Solved the Issue. This happened because I was using an older Version of java which has an Incompatable httpcomponents jar, after switching to the latest version the issue was resolved.