Crashlytics Fabric : Failed to execute task

前端 未结 12 1640
暖寄归人
暖寄归人 2020-12-20 11:04

I\'ve been having an issue and I don\'t know how to fix it.

My project use crashlytics, but it\'s always crash and not sent report. I have a TimeoutException:

<
相关标签:
12条回答
  • 2020-12-20 11:28

    Check Your AndroidManifest.xml file, it contain any provider duplicate or written more than two time that sit.

    Because, This issue is occurred some device specific, before some time I Faced some issue and this is my final solution.

    0 讨论(0)
  • 2020-12-20 11:28

    According to Crashlytics support guide :

    Make sure our SDK line is after all other 3rd-party SDKs

    So try to set Fabric.with(this, new Crashlytics()); after all of your other sdk related initialization if any. If no other sdk initialization there then try to set it after your BuildConfig initialization.

    public class MyApplication extends MultiDexApplication {
    
    @Override
    public void onCreate() {
       super.onCreate();  
    
        if (!BuildConfig.DEBUG) {
            Log.d("Ez", "Release mode. Crashlytics enable");
           //Fabric.with(this, new Crashlytics());
        } else {
            Log.d("Ez", "Debug mode. Crashlytics disable");
        }
       Fabric.with(this, new Crashlytics());
    
       throw new RuntimeException("This is a crash");
      }
    }
    
    0 讨论(0)
  • 2020-12-20 11:29

    In my case, I had some entries in AndroidManifest.xml that were not valid anymore. Java runtime couldn't find them, which caused the crash.

    To be more precise, I was using a Facebook plugin that I removed but left some config entries in AndroiManifest.xml. After I removed them this error disappeared.

    In your case, it could be something else in the AndroidManifest.

    This is one of the possible causes. Each App is different.

    0 讨论(0)
  • 2020-12-20 11:35

    This issue drove me crazy still in 2019, but I think I finally figured out, what did the exception cause.

    I followed all the setup instructions given in the official firebase documentation, but when I tested my solution I didn't get any report on Firebase Crashlytics admin, because of the TimeoutException.

    The reason was in my case, that I triggered the Exception in my main activity's onCreate() or onResume() methods. When I let my app at the first start just run without exception, then later I started to get the reports without any error, so I think it's important, that at the first start the app shouldn't throw any exception in the hook methods.

    Hope my experience helped.

    0 讨论(0)
  • 2020-12-20 11:39

    My solution is next:

    1. Remove all old Fabric related code
    2. Migrate fully app to Firebase. I use link for that
    3. My observation shows Crashlytic sends report next time app is launched and in case app crashes every time in Application::onCreate method you probably won't see any reporting in Firebase console.

    How I test that:

    1. Thrown test exception in Application::onCreate method
    2. Commented that throwing and launch app again
    3. Approximately in a minute I saw crash in Firebase console.

    Hope it also helps you!

    0 讨论(0)
  • 2020-12-20 11:42

    For anyone still struggling with this, I solved it by installing android studio fabric plugin directly via Settings->Plugins android studio and let the plugin edit my code in gradle. You can see it done here : https://www.youtube.com/watch?v=Qvqr6vGzxIs

    0 讨论(0)
提交回复
热议问题