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
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.+'
Check if crashlytics is disabled in build.gradle file
debug {
ext.enableCrashlytics = false
}
Instead use
debug {
ext.enableCrashlytics = true
}
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;
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.
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?!
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'