Alkarin
Alkarin

Reputation: 464

Fabric Crashlytics stuck on build and run

Currently, I'm trying to integrate Crashlytics into an Android Application. However I can't get the app to be recognized and added to the Fabric Dashboard.

When using the Android Studio Fabric plugin following these steps:

  1. New App
  2. Select Crashlytics
  3. Apply Code changes
  4. Sync gradle
  5. Rebuild project
  6. Build app onto device (not virtual)

However when I do this, the Fabric plugin is still stuck on the "Please build and run your application" screen, and eventually gives an error message "It's been a while. Need some help?"

I've also attempted to install Crashlytics manually, by adding the code myself using this link: https://fabric.io/kits/android/crashlytics/install

But when I build the application, still nothing happens within my Fabric Dashboard.

I've attempted checking out the branch again and re-adding this code to no avail. I've also tried reinstalling the Fabric IDE plugin, restarting Android Studio and Restarting my machine.

I have successfully added Crashlytics to other applications following these same steps.

Any ideas?

Upvotes: 9

Views: 4128

Answers (8)

TheTall
TheTall

Reputation: 308

This helped me: https://developer.android.com/studio/build/optimize-your-build#disable-crashlytics-build-id

If you want to use Crashlytics with your debug builds, you can still speed up incremental builds by preventing Crashlytics from updating app resources with its own unique build ID during every build. Because this build ID is stored in a resource file that is referenced by the manifest, disabling automatic build ID generation also allows you to use Apply Changes alongside Crashlytics for your debug builds.

To prevent Crashlytics from automatically updating its build ID, add the following to your build.gradle file:

android {
  ...
  buildTypes {
    debug {
      ext.alwaysUpdateBuildId = false
    }
}

Upvotes: 0

Alex Talcinski
Alex Talcinski

Reputation: 11

I have had a similar problem - month ago I refactored package name and inserted wrong char to name (cyrillic с instead of latin c), what I only have seen now by viewing java code in hex-editor. In the build.gradle applicationId = "package name" was write similar as package name in *.java files, but only all chars were the right in latin. Simple refactoring app package name to right name that equals the appliationId and clean/build project not solve that problem with the Fabric Crashlytics. May be wrong package name stay in another files, not only in *.java, manifest and gradle. I don`t know. Because I made fully refactoring by next step:

1) delete all lines of code that was added by Fabric plugin (if you used automatic code inserting) or that was added by you manually from build.gradle (app), AndroidManifest.xml, MainActivity.java.

2) replace old package name to new by Edit>Find>Replace in Path

3) manually copy all minimal needed project files to new project folder. I copyed these folder and files

NewProjectFolder/build.gradle
NewProjectFolder/app/build.gradle
NewProjectFolder/app/src/*
NewProjectFolder/app/libs/*

4) close current project, at "Welcome to Android Studio" select Import Project and select project in new project folder.

5) make some refactoring to run your app normally (I use Firebase, therefore I add this new app to my Firebase project in Firebase console and download the new google-services.json to NewProjectFolder/app/ )

6) be sure your app runs as well as before refactoring and stop it

7) start Fabric plugin, press "+New App" > "Crashlytycs" > "Install" > "Apply" to make auto-install fabric`s code to your build.gradle (app), AndroidManifest.xml, MainActivity.java.

8) run your app and wait "Done!" on Fabric plugin. After this you can see your app in Crashlytics dashboard.

It has worked for my project and I hope help to you.

Upvotes: 1

Mihae Kheel
Mihae Kheel

Reputation: 2651

Make sure to include all dependencies on their dedicated gradle.build and meta in manifest file. Next is to throw a force runtime error on your device with internet connection also do not forget to initialize it first with Fabric.with(this,new Crashlytics()). If this doesn't work try to download Fabric for Android plugin in Android Studio and select your package.

Upvotes: 0

adrianekafikri
adrianekafikri

Reputation: 368

Also had this issue, then

I refactored my application package name

and

changed application id name in gradle

built it again and the issue was solved.

Upvotes: 0

Afshin
Afshin

Reputation: 977

Probably you forgot to add apply plugin: 'io.fabric' in start of your app level gradle.build file

Upvotes: 1

acvilarim
acvilarim

Reputation: 49

Have same issue here, i resolve doing these things:

First, add at your app build.graddle file:

defaultConfig {
    applicationId "<your package name>"
}

If that doesnt resolve, try change your applicationId to other one, that doesnt match with your package.

For some reason, they worked here.

Upvotes: 0

Tyler
Tyler

Reputation: 19858

I also had this problem. Make sure you rename your application package identically to what the application ID is.

For instance, I had the package structure com/exampleapp/, but it should have been com/companydomain/appname, because the application id was com.companydomain.appname

Upvotes: 0

Guppel
Guppel

Reputation: 71

I just had the same problem - nothing happened in the Fabric-plugin screen saying "Please build and run your application" during app-launches.

It started working after I disabled Instant Run (Preferences > Build Execution Deployment > Instant Run) then rebuilt and run the app.

Upvotes: 6

Related Questions