Open TylerMcCraw opened 5 years ago
The issue is here: https://github.com/willowtreeapps/Hyperion-Android/blob/develop/hyperion-timber/src/main/java/com/willowtreeapps/hyperion/timber/list/TimberLogListActivity.java#L125
My guess is that the intent builder can't handle loading text that is this large.
Solution could be to instead pass a file containing the contents of the logs with the intent.
val logsFile = writeToFile(logs.toString())
val uriToLogs = FileProvider.getUriForFile(context, FILES_AUTHORITY, logsFile)
var shareIntent = ShareCompat.IntentBuilder.from(activity).setStream(uriToLogs).getIntent()
// Provide read access
shareIntent.setData(uriToImage)
shareIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
Did you modify the circular buffer limit in your use case? The default is 200 messages so you're average over 10kB per message which is pretty hefty.
The file writing concept is sound though as an easy fix. If you wanted to create a PR for that, I wouldn't have any issues approving it.
I did not modify the buffer limit. I think that it's possibly due to some of the individual messages being very large in size.
I'll try to get to a PR for that as soon as I can! Is there any concern about adding FileProvider authority with specific file paths for Hyperion? Are there any other Hyperion plugins that do this already?
Nothing comes to mind. @nishtahir you have any problems with this change?
This exception was thrown when clicking on the "SHARE" button from the Hyperion Timber plugin. Our logs were 2172540 bytes (almost 2.2 MB), which isn't very large, but obviously is an accumulation of a decently significant amount of logging.
Using Hyperion version 0.9.27 Crash happened on Samsung Galaxy S9 (Android 9.0) and a Google Pixel 2 XL (Android 10.0).
Stacktrace: