I have two build flavors in gradle but for some reason whenever i change the following flag to false i get the titled error message:
ext.enableCrashlytics = false
the error itself complete is below:
Process: com.mobile.myapp.staging, PID: 5439
java.lang.RuntimeException: Unable to create application com.mobile.myapp.UI.myappApplication: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
install an Android build tool and ask a team member to invite you to this app's organization.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
at android.app.ActivityThread.-wrap1(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1405)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: io.fabric.sdk.android.services.concurrency.UnmetDependencyException: This app relies on Crashlytics. Please sign up for access at https://fabric.io/sign_up,
install an Android build tool and ask a team member to invite you to this app's organization.
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:234)
at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:207)
at io.fabric.sdk.android.InitializationTask.onPreExecute(InitializationTask.java:44)
at io.fabric.sdk.android.services.concurrency.AsyncTask.executeOnExecutor(AsyncTask.java:611)
at io.fabric.sdk.android.services.concurrency.PriorityAsyncTask.executeOnExecutor(PriorityAsyncTask.java:43)
at io.fabric.sdk.android.Kit.initialize(Kit.java:69)
at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:440)
at io.fabric.sdk.android.Fabric.init(Fabric.java:384)
at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:342)
at io.fabric.sdk.android.Fabric.with(Fabric.java:313)
at com.mobile.myapp.UI.base.BaseApplication.setupExceptionHandling(BaseApplication.java:51)
at com.mobile.myapp.UI.myappApplication.onCreate(myappApplication.java:45)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1013)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4707)
And this is how I initialize crashlytics in my Application subclass:
Fabric.with(this, new Crashlytics());
what i am trying to do is have control over whether or not a crashlytics can run or not per flavor. lets say i want flavor1 not to run crashlytics i thought i could use that gradle flag and set it to false. am i missing something ?
Maybe missing apply plugin fabric
I added this line on top of file app/build.gradle
resolved my issues!
apply plugin: 'io.fabric'