简体   繁体   中英

use fabric on Android

I use the fabric in my project.When I use this code classpath 'io.fabric.tools:gradle:1.+ in project's build.gradle and sync project.The following error occurred

Error:Could not find any matches for io.fabric.tools:gradle:1.+ as no versions of io.fabric.tools:gradle are available.
Searched in the following locations:
    file:/D:/dev/androidStudio3.0/androidstudio3.0/AS/gradle/m2repository/io/fabric/tools/gradle/maven-metadata.xml
    file:/D:/dev/androidStudio3.0/androidstudio3.0/AS/gradle/m2repository/io/fabric/tools/gradle/
    https://dl.google.com/dl/android/maven2/io/fabric/tools/gradle/maven-metadata.xml
    https://dl.google.com/dl/android/maven2/io/fabric/tools/gradle/
    https://jcenter.bintray.com/io/fabric/tools/gradle/maven-metadata.xml
    https://jcenter.bintray.com/io/fabric/tools/gradle/
    https://twittersdk.artifactoryonline.com/twittersdk/public/io/fabric/tools/gradle/maven-metadata.xml
    https://twittersdk.artifactoryonline.com/twittersdk/public/io/fabric/tools/gradle/
Required by:
    project :

In your project level gradle add below line

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

in your app level gradle add below line to top off app level gradle

apply plugin: 'io.fabric'

if you are trying to use crashlytics, to import crashlytic library add below code to app level gradle

dependencies {
    implementation('com.crashlytics.sdk.android:crashlytics:2.8.0@aar') {
        transitive = true
    }
}

You can download fabric plugin from,

File->Settings->plugin

Then search for fabric and add that to project and open that will automatically add fabric to your project

I was facing the same issue as you, I resolved it via replacing this classpath

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

Also add this as well in dependencies

 compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
        transitive = true;
    }

I Hope it will help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM