Crashlytics Error:(11, 0) Plugin with id 'io.fabric' not found compile lib

对着背影说爱祢 提交于 2019-11-30 08:19:09

I faced the same issue, when tried to use Fabric plugin for android studio(automated code generation by plugin).I followed this documentation also.

And finally, I could see there were some missed lines in build.gradle.

So this is the top level project build.gradle

 // Top-level build file where you can add configuration options common to all sub-projects/modules.
    buildscript {
        repositories {
            jcenter()
            maven { url 'https://maven.fabric.io/public' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.2.3'
            classpath 'io.fabric.tools:gradle:1.+'
        }
    }
apply plugin: 'java'
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.fabric.io/public' }
        }
    }

and this is the build.gradle for app module

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

    android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "your application package name"
        minSdkVersion 10
        targetSdkVersion 22
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.android.support:support-v4:22.0.0'
    testCompile 'junit:junit:4.12'
    testCompile "org.mockito:mockito-core:1.9.5"
    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
        transitive = true;
    }
}

and at last "clean build" and all was set for me.

I ended up creating an empty project and using the plugin on it and then I compared the gradle file and realized that this was not being added

dependencies {
    classpath 'io.fabric.tools:gradle:1.+'
}
Nagashree

in your project gradle file:

buildscript {
        repositories {
            jcenter()
            maven { url 'https://maven.fabric.io/public' }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:1.2.3'
            classpath 'io.fabric.tools:gradle:1.+'
        }
    }
apply plugin: 'java'
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.fabric.io/public' }
        }
    }

in your app gradle file:

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

    android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "your application package name"
        minSdkVersion 10
        targetSdkVersion 22
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.google.code.gson:gson:2.3'
    compile 'com.android.support:support-v4:22.0.0'
    testCompile 'junit:junit:4.12'
    testCompile "org.mockito:mockito-core:1.9.5"
    compile('com.crashlytics.sdk.android:crashlytics:2.5.2@aar') {
        transitive = true;
    }
}
Mohini Thakkar

You just forget to add below mentioned line in Project level gradle file.

maven { url 'https://maven.fabric.io/public' }

Also please add below mentioned line in dependencies (in project level gradle file)

classpath 'io.fabric.tools:gradle:1.26.1'

I have faced this issue while working with Android + Cordova + Angularjs Hybrid project.

apply plugin: 'io.fabric'

By commenting this line at the path /app/build.gradle solved the issue.

Hope it helps someone!!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!