Posted by Brian Lynn on Nov 26, 2013 in Company, Engineering
It’s that time of year! Time to hang with the fam, write code, and enjoy an ice cold winter lager. All while making sure you’re dressed to impress for the inevitable run in with your old high school flame…
As Thanksgiving approaches, we have a ton of updates to share that are sure to distract you from the very obvious fact that Cousin Sam burned off his eyebrows in the deep fried turkey practice round that went down last weekend! This month, we bring you a new version of the Crashlytics for Android SDK, user experience enhancements to our IDE plugins, and usability upgrades to our web dashboards.
And just to recap–before you caught Grandma putting more wine in her glass than the gravy pan (go Granny!), and even before your little sister brought her tattoo-covered boyfriend home from college — back in October we shared two major announcements back to back: Crashlytics for Android Studio and Crashlytics Real-Time Search.
Performance & Responsiveness
We’re excited to have shipped v1.1.5 of our Android SDK with some serious performance upgrades! (If only there was a way to boost your own performance after you fall into that inevitable Thanksgiving Day food coma).
We tweaked our starting logic to move an extra blocking call off the main thread, reducing our SDK start time by over 75%, so you can get Crashlytics up and running even more efficiently — similar to how that extra cup (or 3) of coffee will have you nailing those Black Friday deals better than ever! To make the Crashlytics logger more useful, we now log priorities and tags to your crash reports as well as the Android logger. We also boosted crash processing efficiency by eliminating unnecessary process data collection and reduced the prioritization of Crashlytics threads to free up even more resources for your app.
When mom asks why we showed up empty handed on Thursday, we’ll have a good excuse: we’ve been busy deploying several updates to our Android IDE plugins to enhance the user experience! These include smart drawing of our plugin to better handle non-IDE windows that have focus, and an even smoother responsiveness of the organization selection screen, which now loads network data asynchronously.
Seamless & Intuitive
For those of you asking for access to the raw stack traces, we heard you loud and clear — even over the sounds of the too-soon holiday music that seems to be glaring from every car stereo anywhere. Our web dashboard now gives you the power to see and copy a raw representation of exceptions and threads. This feature is especially beneficial to our Android developers because you can also use the raw stack inside your IDE, so debugging crashes became easier than ever.
After launching shareable crash reports in September, we added read-only comments to these reports. Now even developers without Crashlytics accounts can view these notes, which can include useful information for collaboration with your team (e.g. JIRA URL). We get it — even if you remembered to put elastic waist pants on before you sat down to eat you still need help from the whole extended family to make a dent in that bird!
To enhance overall usability, we completely revamped the Issue’s session page, along with newly added drop down menus for users to easily navigate between their organizations and applications.
Here’s our internal changelog:
- Reduced SDK start time by over 75% by eliminating a blocking call during exception handler initialization in Crashlytics.start().
- Enhanced Crashlytics.logException(Throwable) to log a warning via Log.w() and immediately return on null input.
- Crashlytics.log(int priority, String tag, String message) now logs the priority and tag to Crashlytics reports as well as the Android logger.
- Removed collection of unused process data to improve crash processing efficiency.
- Explicitly set all Crashlytics background threads to THREAD_PRIORITY_BACKGROUND to defer CPU resources to the application.
- Fixed a bug preventing the Crashlytics SDK from being pulled into Android Studio automatically while adding an application.
- Pushed a non-critical fix to our plugin updater that prevents multiple updates between IDE restarts.
- Enhanced the UI of our modals and notes section as well as added the ability for users to filter out versions directly from the dropdown menu.
- Added raw stack traces so developers can now see and copy a raw representation of the exceptions and threads.
- Added read-only comments in shared crashes so notes are visible to team members who got the shared link but didnt have a Crashlytics account.
- Revamped UI for Modals and Notes.
- Added filters to Dropdown menus.
- Won the office-wide “Movember” contest (Tom Selleck truly is an inspiration).
It’s been quite a busy fall season for us but we look forward to shipping even more features before the year’s end. In the meantime, we’ll catch up with you guys on the other side of the holiday — save us some leftovers! Now, back to googling “Thanksgiving puns”…I mean…writing code
Happy Halloween from our (Crashlytics) family to yours! Over at CrashHQ we’ve somehow managed to find time to ship two major product updates this month (more on that later) — which is surprising considering how much time “some” of us spent infusing locally distilled vodka with fresh pumpkin and hand-embroidering “Doogie Howser, M.D.” onto that lab coat we bought at Good Will.
But even before October rolled around and we started getting into heated discussions with our co-workers born after 1990 about the blasphemy of never having heard of half the potential costumes one could create based on Mike Myers SNL skits, we accomplished a lot. In fact, last month we released an even lighter-weight version of our Android SDK, improved IDE plugin features, and easily shareable crash reports. This month we kept up that same momentum and launched Crashlytics for Android Studio and Crashlytics Real-time search!
Support for Android’s Next Big Thing
When Google first announced Android Studio last spring, Android developers everywhere were excited to start building their apps in an IDE designed specifically for them. This month, we released our plugin for Android Studio, bringing the power of Crashlytics to Android’s premier IDE, complete with robust Gradle support. Much like our plugins for Eclipse and IntelliJ, we made it seamless to integrate Crashlytics into your Android Studio workflow, along with access to the same powerful features: real-time issue browsing, SDK addition to new apps, and fully automated ProGuard deobfuscation. Again, all while searching the entire Greater Boston Area for the perfect, most-historically-accurate Salvador Dali mustache
We also created a more dynamic and responsive interface shared by all of our Android plugins. The new UI sports slick page transition animations, an app selection screen that tells you exactly which apps are already configured for Crashlytics, and the option to easily switch between your apps. Regardless of your choice between Android Studio, Eclipse and IntelliJ, you can have an effortless and streamlined debugging experience. (Picture taking your kids trick-or-treating without the inevitable sugar-induced melt down!)
Locate Issues from Anywhere, Anytime
When we first launched our iOS and Android SDKs, our unique logging features allowed developers to capture logged data with highly actionable insights. For our new real-time search functionality, we dramatically increased the flexibility and search precision by creating new indices to capture custom keys, logged events and custom user fields. This gives you the power to instantly locate the exact crashes you’re looking for with vivid details, along with the option to search across all build versions or hone-in on a single one.
Here’s our internal changelog:
- Fixed CrashlyticsMissingDependencyException when building with aapt’s –rename-manifest-package option.
- Upgraded plugins to go directly to issue browser on launch.
- Improved display of app and user names that use non-ASCII characters.
- Integrated new components of a new standard UI library such as a new sidebar and other components swaps.
- Switched the office kegerator over to a frosty pumpkin ale.
- Took the My-Kid-Has-the-Cutest-Costume contest offline by having a company Halloween party.
- Finally nailed consuming the right amount of candy at said party as to not get a stomach ache (speaking for our children, not ourselves).
You’ve put away the beach chairs, said goodbye to pina coladas and hello to an ice cold beer and college football. With Fall rolling in, you are probably reminiscent of your first few days going back-to-school: running anxiously to catch the school bus, hoping your schoolyard crush would sit next to you in class. At Crashlytics, we want you to be just as excited about getting back to building your favorite apps, so we’ve fueled up on caffeine and pulled a few all-nighters to bring you some developer-life-changing upgrades!
Last month, we improved the user experience for our Android IDE Plugins and support for custom builds in Gradle. This month, we launched an even more lightweight version of the Android SDK, convenient features inside IDE plugins, as well as the best collaboration experience for any mobile development team.
The Next Level of Lightweightness & Convenience
We’re sensitive to how our footprint impacts your environment, which is why we paid attention to even the finest details when launching version 1.0.4 of our Android SDK. The new version minimizes the SDK’s network usage and disk space requirements, and we did it by reducing the size of logged exception reports by as much as 75%.
We also improved the cleanup process for cached Crashlytics reports, which saves even more space and further lower network usage by eliminating unnecessary session reporting. It’s like getting those extra large lockers where you can hide yourself from a dreaded and mean principal!
Seamless Web Experience and Collaboration
You know the feeling when you waltz into the cafeteria on the first day of school and breeze your way through the lunch line, knowing exactly what foods to avoid and the usual table where all your best friends are sitting at. That’s exactly the smooth experience we created for you with the upgrades to our web dashboard.
We’ve added new functionality so that the number of comments, crashes and other key information are updated in real-time — so you can relax, sit back and get all the relevant data without having to refresh the page. It’s like having all the answers to a pop quiz coincidentally saved in your graphing calculator.
Remember that time in kindergarten when someone stole your favorite toy and the teacher yelled and said “you need to share.” Well, we haven’t forgotten the importance of sharing, which is why earlier this month we introduced our sharing feature. You can now share your crash reports on sites like Stackoverflow with greater context and lucid details, while keeping all sensitive information private.
We wanted to give you the power to not only collaborate with your team, but to tap into the expertise of your entire developer network. So you can be confident that you can quickly resolve any issues — like senior-year-of-high-school-football-quarterback-confident!
Here’s our internal changelog:
- Dramatically improved support for the arm64 architecture.
- Improved app icon update logic to reduce network bandwidth.
- Fixed a bug that leads to an ANR, in extremely rare cases, after crashes that can occur during an app launch.
- Added a default versionName to prevent a minor issue when versionName is not in the AndroidManifest.
- Fixed a bug that occured when the versionCode is omitted from the AndroidManifest.
- Improved plugin behavior on attempted logins without an internet connection.
- Improved support for communicating with our servers through network proxies.
- Improved user flow for confirming and disabling crash collections.
There’s an age-old saying: talent wins games, but teamwork wins championships. Here at Crashlytics, we made it our goal to help you and your team collaborate to build amazing and the most stable apps, so that you can hit a homerun…Bottom-of-the-9th-walkoff-1988-World-Series style!
Developers who use Crashlytics have been able to find and fix their bugs with tremendously less effort, thanks to our real-time reports that intelligently prioritize issues. But like any MVP, even the brightest developers run into hurdles at some point and need help from their team. So we set out to make our crash reports shareable, giving you the power to fix the most challenging bugs in minimal time.
Detailed, Easy-to-Share Crash Reports
As a Crashlytics user, in just a simple click of a button, you can share the intricate details of each issue with your team — without even leaving the admin dashboard.
You can also collaborate with your team to fix incoming bugs in real-time, either by sharing the report via the email button, or using the sexy short link (crashes.to/…) in your favorite IRC client. While it may not be exactly what James Earl Jones said in Field of Dreams, developers now have a new motto: “if you share it, they will help.”
Beyond Your Team’s Expertise
It’s clear that collaboration is key to building awesome apps. Beyond just your team, you can now tap into the expertise within the developer community. With the short direct link, you can share your crash report on sites like Stackoverflow, without having to format code blocks or type out any cumbersome device information.
Many top apps have already started sharing their crash reports, and absolutely love the feature. In their words:
“This feature has already proven extremely useful. Not only can i show the exception to my team, but also post it on StackOverflow with greater context and finite details, which makes it more likely for others to be able to help!”
JOE SCOTT – BROAKENMEDIA
“The sharing feature is
so simple yet extremely helpful. We can now quickly share
crash reports within our team, as well as with 3rd party SDK developers and others within the community, all the while keeping our
BRYAN RAHN – MOBIATA
“Sharing is great when we need to attach crash logs to Apple bug reports, especially when we can’t reproduce the crashes locally. All we have to do is copy and paste, and Apple receives a perfectly symbolicated crash log. Perfect!”
ANDREW AUDE – VENMO
Imagine getting feedback from developers who know their craft; it’s like having thousands of John Maddens, live on ESPN, in your pocket, always–if John Madden only ever gave you super constructive feedback on your code!
Private and Secure
We understand that sharing your crashes can be a sensitive subject. No worries! Our shared reports show only the information that will be most helpful for you in resolving the issues. Each one comes with the usual deliciousness that you could expect: stacktraces, device state, operating systems etc. We don’t share the total volume of crashes, or the number of users that were affected. Also, you can always make your crash report private with one click, after having shared it publicly.
We’re developers too, so we know that you enjoy sharing big challenges that you solved, especially the really hard problems from OS nuances, 3rd party libraries, or tricky workarounds.
Despite #23’s multiple MVP seasons (that’s Michael Jordan for anyone who doesn’t speak sports…), he too recognized the need for a strong team to win those back-to-back championships. That’s where we come in; we build tools to help you solve big challenges with your team and the help of the community, so your app continues to win in the big leagues!
While the Peter Pan in all of us loves a good summer vacation, over at Crashlytics we’ve been working hard the last couple months to make sure that by the time those back to school ads start running, and all the sand is washed out of your hair, we’ll have tons of upgrades to show off to you, along with all the “true” stories about how we totally got into that P-Diddy party in the Hamptons that one time.
In July (while you were working on your tan) we enhanced our SDKs’ features, shipping even more robust crash reporting functionality and powerful processing capabilities. And in August (while you were nursing your sunburn) we took it one step further, improving even the finest details of our Android IDE plugins with a seamless user experience, as well as enhancing the flexibility of our Gradle plugin to support any custom builds!
Dazzling Experience for Intellij and Eclipse Plugins
We get it. When adding new libraries or plugins to development projects, you want to see how the change might affect your code and feel completely confident—like I-stood-up-on-my-paddleboard-on-the-first-try-confident. That’s why we created a new, slick UI for getting Crashlytics up and running with a preview screen that gives you even greater visibility into the code. But we didn’t stop there, we’ve made the UI extra responsive, with hover and pressed states on clickable links.
To keep your project folders streamlined, we moved all Crashlytics data caches to OS-dependent cache locations. This way, the caches are still there, and you can access them whenever you need to. As a bonus (think free tickets to that labor day destination wedding) we also fixed a critical issue for you here, if you weren’t running your IDE with admin privileges.
Upgraded Support for Custom Builds in Gradle
Picture this: you arrive at your favorite beach, strut down the sand greeting friends, score the perfect spot near the snack shack, then drop and successfully unfurl your beach chair on the first try without the slightest hesitation. That’s the type of flawless experience we want you to have when using Crashlytics to build APKs, so we set out to improve the support for non-standard build configurations in our Gradle plugin. Because we automatically detect customizations from the gradle file directly, you don’t need to add extra Crashlytics-specific configuration params!
Here’s our internal changelog:
- Solved build processing and graphics related bugs.
Android IDE Tools
- Added a prompt for users with an expired token to re-login.
- Greatly improved the runtime performance of the plugin updater.
- Fixed a bug that can cause updates to fail in rare circumstances.
- Deployed a new WWW architecture based on modules allowing the client to request only the code required for that specific page. This should make page loads much, much faster.
We hope these updates make developing out-of-this-world apps, and the transition from summer to fall a bit easier on you. And as you pack away your miniature drink umbrellas and mentally prepare for pumpkin flavored beer you can now proudly add another Crashlytics blog post to your summer reading list. Don’t worry, we won’t tell anyone you didn’t get all the way through Infinite Jest like you had planned
At Crashlytics, we‘re constantly exploring ways to help developers build the most stable apps. With this in mind, we recently began researching common reasons why Android apps crash. We were especially curious to see any trends in crashes originating from the Android Support Library, given that it is one of the most widely-used libraries in Android applications.
We found that about 4% of the 100 million crashes that we analyzed were related to the Support Libraries. Digging deeper, our research showed that the overwhelming majority of those crashes are caused by a small handful of recurring, preventable errors. Based on this analysis, we’ve identified the best practices for using the Support Libraries that are commonly overlooked and three key ways to increase stability.
1. AsyncTasks and Configuration Changes
AsyncTasks are used to perform background operations and optionally update the UI after completion. Using
AsyncTasks and handling configuration changes is a common source of bugs. If the fragment is detached from its activity while your
AsyncTask is running, and you attempt to access that activity, your application will crash with a call stack that looks like:
java.lang.IllegalStateException: Fragment MyFragment not attached to Activity
In the above stack trace, the fragment is relying on a valid activity to access the application’s resources. One way to prevent this crash from happening is to retain the
AsyncTask across configuration changes.
This can be done using a
RetainedFragment that executes the
AsyncTask and notifies listeners about the status of the
AsyncTask operations. For more information, see the FragmentRetainInstance.java sample.
2. Safely Performing Fragment Transactions
Fragment transactions are used to add, remove, or replace fragments in an activity. Most of the time, fragment transactions are performed in the activity’s
onCreate() method or in response to a user interaction. However, we’ve seen cases where fragment transactions were committed when resuming an activity. When this happens, your application may crash with the following:
java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
FragmentActivity is placed in the background, its
mStateSaved flag is set to true. This flag is used to check whether there could be state loss. If the flag is true when attempting to commit a transaction, the above
IllegalStateException is thrown. To prevent state loss, fragment transactions cannot be committed after
onSaveInstanceState() is called. The reason this crash may occur is that there are some cases in which
onResume() is called before the flag is set back to false, when the state is restored.
To prevent this kind of crash, avoid committing fragment transactions in the activity’s
onResume() method. Instead, use
onResumeFragment(), which is the recommended approach to interact with fragments in their proper state.
3. Managing the Cursor Lifecycle
CursorAdapter makes it easy to bind data from a
Cursor to a
ListView object. However, if the cursor becomes invalid and we attempt to update the UI, the following crash occurs:
java.lang.IllegalStateException: this should only be called when the cursor is valid
This exception is thrown if the
mDataValid field is set to false, which happens when:
- the cursor is set to null
- a requery operation on the cursor failed
onInvalidated() is called on the data
One reason this may occur is if you’re using both
startManagingCursor() to manage your cursor.
startManagingCursor() has been deprecated in favor of
CursorLoader. If you are working with fragments, be sure to use
CursorLoader to manage the cursor lifecycle and remove all references to
By implementing these three guidelines, the chances of the Support Library throwing a fatal exception will be greatly diminished. Fewer crashes lead to happier customers, better ratings, and a more successful app!
Crashlytics for Android reports uncaught exceptions thrown by the Support Library or anywhere else in your app. Add our Android SDK to your app and see what other crashes you’ve been missing!