Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with fabric crash report #10

Closed
Piasy opened this issue Oct 6, 2015 · 3 comments
Closed

Problem with fabric crash report #10

Piasy opened this issue Oct 6, 2015 · 3 comments
Assignees
Milestone

Comments

@Piasy
Copy link
Contributor

Piasy commented Oct 6, 2015

After install successfully, the app crash with error below:

io.fabric.sdk.android.services.concurrency.UnmetDependencyException: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
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:297)
    at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:231)
    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:66)
    at io.fabric.sdk.android.Fabric.initializeKits(Fabric.java:431)
    at io.fabric.sdk.android.Fabric.init(Fabric.java:375)
    at io.fabric.sdk.android.Fabric.setFabric(Fabric.java:332)
    at io.fabric.sdk.android.Fabric.with(Fabric.java:303)
    at com.github.piasy.template.features.splash.SplashActivity$2$2.call(SplashActivity.java:154)
    at com.github.piasy.template.features.splash.SplashActivity$2$2.call(SplashActivity.java:123)
    at rx.Observable.unsafeSubscribe(Observable.java:7710)
    at rx.internal.operators.OperatorSubscribeOn$1$1.call(OperatorSubscribeOn.java:62)
    at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
    at java.lang.Thread.run(Thread.java:841)
Caused by: com.crashlytics.android.core.CrashlyticsMissingDependencyException: 
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.BuildIdValidator.validate(BuildIdValidator.java:59)
    at com.crashlytics.android.core.CrashlyticsCore.setAndValidateKitProperties(CrashlyticsCore.java:336)
    at com.crashlytics.android.core.CrashlyticsCore.onPreExecute(CrashlyticsCore.java:255)
 ... 21 more

It seems the fabric app secret could not be read at runtime in buck build, which works well with gradle build.

@Piasy Piasy added the bug label Oct 6, 2015
@Piasy Piasy self-assigned this Oct 6, 2015
@Piasy Piasy added this to the v1.0.0 milestone Oct 6, 2015
@Piasy
Copy link
Contributor Author

Piasy commented Oct 11, 2015

After dig into this problem (via step-by-step debug), I find out that the build with gradle will create a APK with a string resource named com.crashlytics.android.build_id, while the build with buck not. And fabric (Crashlytics) will fire the UnmetDependencyException exception if this string resource doesn't exist.

So the problem doesn't relate to fabric app secrete of ApiKey, it's the build id.

Since this build id (an uuid I guess) is generated by fabric gradle plugin, and will be uploaded to fabric's server (I guess) during the gradle build, neither BUCK nor OkBuck could handle this problem.

The workaround is to define a BuildConfig in build.gradle, with default value to disable fabric (not call Fabric.with(...) method) but flavor value to enable it. Then use OkBuck and BUCK in daily develop build, but use gradle build to release.

B.T.W. I think gradle build is unavoidable because BUCK doesn't support multi-product flavor and other gradle build features, which are very useful when create release build.

@bagrusss
Copy link

bagrusss commented Oct 18, 2016

if you use gradlew via terminal, add for current productFlavor this string:
resValue "string", "com.crashlytics.android.build_id", UUID.randomUUID().toString()

@kageiit
Copy link
Contributor

kageiit commented Oct 18, 2016

@bagrusss thanks for the idea. Will add that to the wiki

cwoodwar6 pushed a commit to cwoodwar6/okbuck that referenced this issue Jul 27, 2017
…o master

* commit '59bc6fbe8b69da8ca16adbc600928eeafab69ed1':
  Publish v0.21.0
  Migrate to kotlin in memory compiler support in buck (uber#450)
  Change how dependencies are resolved in preparation for Andrioid Gradle Plugin 3.x (uber#451)
  Switch the ordering of build config fields. (uber#449)
  Publish v0.20.10
  Revert "Add empty resource rule if using resource union. (uber#438)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants