How can I fix this CrashlyticsMissingDependencyException?

后端 未结 17 1496
耶瑟儿~
耶瑟儿~ 2020-12-04 18:42

I have been using the latest Crashlytics (Fabric integration) for a while. But recently I encountered the following crash error due to missing dependency although I didn\'t

相关标签:
17条回答
  • 2020-12-04 19:12

    Seems like specifying the plugin version as:

    classpath 'io.fabric.tools:gradle:1.+' 
    

    picks up 1.15.1, which has the problem.

    Specifying major and minor to previous 1.14 seems to be stable:

    classpath 'io.fabric.tools:gradle:1.14.+'
    
    0 讨论(0)
  • 2020-12-04 19:13

    Check if crashlytics is disabled in build.gradle file

        debug {
            ext.enableCrashlytics = false
        }
    

    Instead use

        debug {
            ext.enableCrashlytics = true
        }
    
    0 讨论(0)
  • 2020-12-04 19:14

    The issue also occurs if you accidentally include the Crashlytics BuildConfig - very easy to do with Android Studio/IntelliJ auto-imports.

    I'd imported

    import com.crashlytics.android.core.BuildConfig;

    Instead of my own

    import <package_name>.BuildConfig;

    0 讨论(0)
  • 2020-12-04 19:21

    Make sure to add apply plugin: 'io.fabric' into your application project build.gradle. In my case, I had a common build.gradle with apply plugin: 'io.fabric'. Moving it to application project solved the problem.

    0 讨论(0)
  • 2020-12-04 19:22

    Removing the application icon fixed Crashylitics, whaaat?

    I had everything done based on the onboarding tutorial, using the latest versions, etc.

    Just wasted an hour trying to figure this out. It turns out someone thought it was a good idea to read the package name of the application icon instead of context.packageName to get the application's resources given a context. It's done in this method:

    io.fabric.sdk.android.services.common.CommonUtils#getResourcePackageName

    This obviously blows up if you happen to use an icon that's not inside the APK, for example: android:icon="@android:drawable/sym_def_app_icon". It probably was a good idea at the time, wonder what weird bug they were trying to work around?!

    0 讨论(0)
  • 2020-12-04 19:23

    The only workaround for now, if you really need to publish your app (like me), is to change the dynamic version numbers to static ones:

    [...]
    
    classpath 'io.fabric.tools:gradle:1.14.4'
    
    [...]
    
    compile('com.crashlytics.sdk.android:crashlytics:2.2.0@aar') {
            transitive = true
    }
    
    [...]
    

    EDIT:

    an updated version of the Fabric SDK has been published; you can get it by changing the line to this:

    classpath 'io.fabric.tools:gradle:1.26.1'
    
    0 讨论(0)
提交回复
热议问题