Fabric crashlytics with Firebase unable to upload crash - android

I'm just trying to migrate Fabric Crashlytics with Firebase, so I just followed the guide https://firebase.google.com/docs/crashlytics/get-started
Everything compiles and the app can be launched. So I want to simulate a crash with Crashlytics.getInstance().crash(); as I already used before.
The app crashes as expected, but the crash is not uploaded to firebase and I have this strange stack:
E/Fabric: Error performing auto configuration.
io.fabric.sdk.android.services.network.HttpRequest$HttpRequestException: java.net.ProtocolException: Too many follow-up requests: 21
at io.fabric.sdk.android.services.network.HttpRequest.code(HttpRequest.java:1355)
at io.fabric.sdk.android.services.settings.AbstractAppSpiCall.invoke(AbstractAppSpiCall.java:86)
at io.fabric.sdk.android.services.settings.UpdateAppSpiCall.invoke(UpdateAppSpiCall.java:29)
at io.fabric.sdk.android.Onboarding.performUpdateApp(Onboarding.java:204)
at io.fabric.sdk.android.Onboarding.performUpdateApp(Onboarding.java:194)
at io.fabric.sdk.android.Onboarding.performAutoConfigure(Onboarding.java:175)
at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:112)
at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:45)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:762)
Caused by: java.net.ProtocolException: Too many follow-up requests: 21
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:451)
at com.android.okhttp.internal.huc.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:567)
at com.android.okhttp.internal.huc.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
at com.android.okhttp.internal.huc.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java)
Anyone already had encountered this error?

This can happen when you strip the API key from Fabric when migrating from Fabric to Firebase Crashlytics, which is not currently supported. When migrating, keep your API key in your project.

Related

How to get io.fabric.ApiKey?

I am getting below error but I am not able to figure out how can I get the api key for io.fabric.ApiKey.
java.lang.IllegalArgumentException: Fabric could not be initialized, API key missing from AndroidManifest.xml. Add the following tag to your Application element
<meta-data android:name="io.fabric.ApiKey" android:value="YOUR_API_KEY"/>
at io.fabric.sdk.android.services.common.ApiKey.logErrorOrThrowException(ApiKey.java:110)
at io.fabric.sdk.android.services.common.ApiKey.getValue(ApiKey.java:61)
at io.fabric.sdk.android.services.settings.Settings.initialize(Settings.java:78)
at io.fabric.sdk.android.Onboarding.retrieveSettingsData(Onboarding.java:124)
at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:99)
at io.fabric.sdk.android.Onboarding.doInBackground(Onboarding.java:45)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at java.lang.Thread.run(Thread.java:776)
Firebaser here -- the Fabric dashboard has been deprecated, which means you can no longer access the API key. You can upgrade from the Fabric SDK to the Firebase Crashlytics SDK, which doesn't require the Fabric API key to identify your app but rather the google-services.json file.

Google Places API Crash Javalite clash with other Firebase APIs

When I leave the Google Places API on idle after initialization, the application crashes with the stack trace as described at the end of this description.
I initialize the Places API once and only once in the manner described below
if(!Places.isInitialized()) {
val apiKey = loadApiKey()
Places.initialize(getApplication(), apiKey)
}
val client = Places.createClient(getApplication())
After running the above method and left on idle, the application crashes with the following stack trace.
I am assuming this is happening because of a clash between my javalite libraries and the protobuf java libraries.
java.lang.ExceptionInInitializerError
at com.google.android.datatransport.cct.a.zze.zzb(com.google.android.datatransport:transport-backend-cct##2.1.0:1)
at com.google.android.datatransport.cct.zzc.send(com.google.android.datatransport:transport-backend-cct##2.1.0:9)
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.logAndUpdateState(com.google.android.datatransport:transport-runtime##2.1.0:121)
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.lambda$upload$1(com.google.android.datatransport:transport-runtime##2.1.0:88)
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader$$Lambda$1.run(Unknown Source:8)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.RuntimeException: Unable to get message info for com.google.android.datatransport.cct.a.zze
at com.google.protobuf.GeneratedMessageInfoFactory.messageInfoFor(GeneratedMessageInfoFactory.java:62)
at com.google.protobuf.ManifestSchemaFactory$CompositeMessageInfoFactory.messageInfoFor(ManifestSchemaFactory.java:143)
at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:55)
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:93)
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:107)
at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:175)
at com.google.android.datatransport.cct.a.zze.<clinit>(com.google.android.datatransport:transport-backend-cct##2.1.0:2)
at com.google.android.datatransport.cct.a.zze.zzb(com.google.android.datatransport:transport-backend-cct##2.1.0:1) 
at com.google.android.datatransport.cct.zzc.send(com.google.android.datatransport:transport-backend-cct##2.1.0:9) 
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.logAndUpdateState(com.google.android.datatransport:transport-runtime##2.1.0:121) 
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.lambda$upload$1(com.google.android.datatransport:transport-runtime##2.1.0:88) 
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader$$Lambda$1.run(Unknown Source:8) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 
Caused by: java.lang.UnsupportedOperationException
at com.google.android.datatransport.cct.a.zze.dynamicMethod(com.google.android.datatransport:transport-backend-cct##2.1.0:2)
at com.google.protobuf.GeneratedMessageLite.dynamicMethod(GeneratedMessageLite.java:256)
at com.google.protobuf.GeneratedMessageLite.buildMessageInfo(GeneratedMessageLite.java:284)
at com.google.protobuf.GeneratedMessageInfoFactory.messageInfoFor(GeneratedMessageInfoFactory.java:60)
at com.google.protobuf.ManifestSchemaFactory$CompositeMessageInfoFactory.messageInfoFor(ManifestSchemaFactory.java:143) 
at com.google.protobuf.ManifestSchemaFactory.createSchema(ManifestSchemaFactory.java:55) 
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:93) 
at com.google.protobuf.Protobuf.schemaFor(Protobuf.java:107) 
at com.google.protobuf.GeneratedMessageLite.makeImmutable(GeneratedMessageLite.java:175) 
at com.google.android.datatransport.cct.a.zze.<clinit>(com.google.android.datatransport:transport-backend-cct##2.1.0:2) 
at com.google.android.datatransport.cct.a.zze.zzb(com.google.android.datatransport:transport-backend-cct##2.1.0:1) 
at com.google.android.datatransport.cct.zzc.send(com.google.android.datatransport:transport-backend-cct##2.1.0:9) 
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.logAndUpdateState(com.google.android.datatransport:transport-runtime##2.1.0:121) 
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader.lambda$upload$1(com.google.android.datatransport:transport-runtime##2.1.0:88) 
at com.google.android.datatransport.runtime.scheduling.jobscheduling.Uploader$$Lambda$1.run(Unknown Source:8) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at java.lang.Thread.run(Thread.java:919) 
There might be an issue with the library's protobuffer integration clashing with the one I am using within my application.
As per this issue tracker I created and mentioned by the comments.
https://issuetracker.google.com/issues/161157921.
For now, simply add the following to update the internal Places dependencies on Protobufer libraries until they push out a Places version > 2.3.0
implementation 'com.google.android.datatransport:transport-runtime:2.2.3'
implementation 'com.google.android.datatransport:transport-backend-cct:2.3.0'

Proguard issue when trying to login with Firebase UI Auth

I am using Firebase UI Auth to login into the application. The debug build is working fine but when I try to login with the release build the application crashes with an error.
2018-10-02 14:05:23.072 4827-4866/io.palette E/c.b.a.J: Creating atomic field updaters failed
java.lang.RuntimeException: java.security.PrivilegedActionException: java.lang.NoSuchFieldException: No field streamClosed in class Lc/b/a/J$c; (declaration of 'c.b.a.J$c' appears in /data/app/io.palette-1/base.apk)
at java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:380)
at java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:58)
at c.b.a.J.<clinit>(:77)
at c.b.a.c.c(:420)
at c.b.a.c.a(:395)
at com.google.firebase.firestore.f.zzd.<init>(:102)
at com.google.firebase.firestore.b.zzg.zza(:1217)
at com.google.firebase.firestore.b.zzi.run()
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:272)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
at com.google.firebase.firestore.g.zza$zza.run(:190)
at java.lang.Thread.run(Thread.java:761)
What could be the possible reason for this?

Malformed exception in fabric library

Recently I see an exception in my log that fabric (Beta) tries to check for updates and this is the error:
E/Beta: Error while checking for updates from null
io.fabric.sdk.android.services.network.HttpRequest$HttpRequestException: java.net.MalformedURLException: Protocol not found: null?instance=
I don't know why fabric tries to check for updates with a null URL, but I really want to remove that error.
Verbose stack trace:
E/Beta: Error while checking for updates from null
io.fabric.sdk.android.services.network.HttpRequest$HttpRequestException: java.net.MalformedURLException: Protocol not found: null?instance=7f856ab5-12f8-4723-9e84-569dab8e9760&build_version=1030300&display_version=1.3.3&source=3
at io.fabric.sdk.android.services.network.HttpRequest.encode(HttpRequest.java:722)
at io.fabric.sdk.android.services.network.HttpRequest.get(HttpRequest.java:865)
at io.fabric.sdk.android.services.network.DefaultHttpRequestFactory.buildHttpRequest(DefaultHttpRequestFactory.java:85)
at io.fabric.sdk.android.services.common.AbstractSpiCall.getHttpRequest(AbstractSpiCall.java:137)
at com.crashlytics.android.beta.CheckForUpdatesRequest.invoke(CheckForUpdatesRequest.java:48)
at com.crashlytics.android.beta.AbstractCheckForUpdatesController.performUpdateCheck(AbstractCheckForUpdatesController.java:166)
at com.crashlytics.android.beta.AbstractCheckForUpdatesController.checkForUpdates(AbstractCheckForUpdatesController.java:139)
at com.crashlytics.android.beta.AbstractCheckForUpdatesController.initialize(AbstractCheckForUpdatesController.java:91)
at com.crashlytics.android.beta.Beta.doInBackground(Beta.java:78)
at com.crashlytics.android.beta.Beta.doInBackground(Beta.java:30)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63)
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28)
at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
Caused by: java.net.MalformedURLException: Protocol not found: null?instance=7f856ab5-12f8-4723-9e84-569dab8e9760&build_version=1030300&display_version=1.3.3&source=3
at java.net.URL.<init>(URL.java:176)
at java.net.URL.<init>(URL.java:125)
at io.fabric.sdk.android.services.network.HttpRequest.encode(HttpRequest.java:720)
at io.fabric.sdk.android.services.network.HttpRequest.get(HttpRequest.java:865) 
at io.fabric.sdk.android.services.network.DefaultHttpRequestFactory.buildHttpRequest(DefaultHttpRequestFactory.java:85) 
at io.fabric.sdk.android.services.common.AbstractSpiCall.getHttpRequest(AbstractSpiCall.java:137) 
at com.crashlytics.android.beta.CheckForUpdatesRequest.invoke(CheckForUpdatesRequest.java:48) 
at com.crashlytics.android.beta.AbstractCheckForUpdatesController.performUpdateCheck(AbstractCheckForUpdatesController.java:166) 
at com.crashlytics.android.beta.AbstractCheckForUpdatesController.checkForUpdates(AbstractCheckForUpdatesController.java:139) 
at com.crashlytics.android.beta.AbstractCheckForUpdatesController.initialize(AbstractCheckForUpdatesController.java:91) 
at com.crashlytics.android.beta.Beta.doInBackground(Beta.java:78) 
at com.crashlytics.android.beta.Beta.doInBackground(Beta.java:30) 
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:63) 
at io.fabric.sdk.android.InitializationTask.doInBackground(InitializationTask.java:28) 
at io.fabric.sdk.android.services.concurrency.AsyncTask$2.call(AsyncTask.java:311) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423) 
at java.util.concurrent.FutureTask.run(FutureTask.java:237) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
at java.lang.Thread.run(Thread.java:818) 
I solved a lot of errors logs and the exception above by updating the crashlytics library version.
I also have solved this issue updating Crashlytics version in /app/build.gradle file.
I leave here the code of the fix for convenienece:
dependencies {
compile('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') {
transitive = true;
}
}

Crashlytics Answers throwing error with Android instant apps

I am using Crashlytics version 2.6.8 for my Android app. I have configured Crashlytics in base feature following answer here. Crashlystics is initialized with Fabric using following code snippet
Fabric.with(context, crashlyticsKit);
Crashlytics Answers throws this exception on startup of Android instant apps
E/Answers: Failed to enable events
java.io.IOException: ftruncate failed: EACCES (Permission denied)
at java.io.RandomAccessFile.setLength(RandomAccessFile.java:630)
at io.fabric.sdk.android.services.common.QueueFile.initialize(QueueFile.java:213)
at io.fabric.sdk.android.services.common.QueueFile.<init>(QueueFile.java:130)
at io.fabric.sdk.android.services.events.QueueFileEventStorage.<init>(QueueFileEventStorage.java:58)
at io.fabric.sdk.android.services.events.GZIPQueueFileEventStorage.<init>(GZIPQueueFileEventStorage.java:32)
at com.crashlytics.android.answers.AnswersFilesManagerProvider.getAnalyticsFilesManager(AnswersFilesManagerProvider.java:44)
at com.crashlytics.android.answers.AnswersEventsHandler$4.run(AnswersEventsHandler.java:121)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:269)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at io.fabric.sdk.android.services.common.ExecutorUtils$1$1.onRun(ExecutorUtils.java:75)
at io.fabric.sdk.android.services.common.BackgroundPriorityRunnable.run(BackgroundPriorityRunnable.java:30)
at java.lang.Thread.run(Thread.java:818)
Caused by: android.system.ErrnoException: ftruncate failed: EACCES (Permission denied)
at libcore.io.Posix.ftruncate(Native Method)
at libcore.io.BlockGuardOs.ftruncate(BlockGuardOs.java:148)
at java.io.RandomAccessFile.setLength(RandomAccessFile.java:628)
Is it caused due to storage access? If so, Is it possible to configure Crashlytics from accessing storage in case of Instant apps?
It doesn't seem like you are initializing Answers itself, only Crashlytics?
Try something like this if you want Crashlytics and Answers from Fabric:
final Fabric fabric = new Fabric.Builder(this)
.kits(new Crashlytics(), new Answers())
.debuggable(true)
.build();
Fabric.with(fabric);

Categories

Resources