Now in Kotlin!
A tool for debugging TransactionTooLargeException on Android.
"Most underrated solution." - Kedar Paranjape, Jun 7 '18 at 14:26
-
Include
toolargetoolas a dependency (you can remove it again once you've debugged your crash):-
Add
maven { url 'https://dl.bintray.com/guardian/android' }in your project'sbuild.gradle:allprojects { repositories { jcenter() ... maven { url 'https://dl.bintray.com/guardian/android' } } } -
Add
implementation 'com.gu.android:toolargetool:0.2.1@aar'in your module'sbuild.gradle:dependencies { ... implementation 'com.gu.android:toolargetool:0.2.1@aar' }
-
-
Add code to start logging during app start, for example in your
Application.onCreatemethod:TooLargeTool.startLogging(this); -
Monitor logcat output to see which components are writing substantial data to the transaction buffer and when:
$ adb logcat -s TooLargeToolExample logcat output (TODO: improve this example):
D/TooLargeTool: MainActivity.onSaveInstanceState wrote: Bundle@200090398 contains 1 keys and measures 0.6 KB when serialized as a Parcel * android:viewHierarchyState = 0.6 KB
Note: these instructions will only work if you have the relevant Bintray credentials
- Open
toolargetool/bintray.gradle. - Increase all the version numbers.
- Make a commit and tag it with
git tag -a v<version number> -m "<message>". - Run
./gradlew clean install && ./gradlew bintrayUpload.