alex

98 months ago

 - via web

- Story

How we fixed the face-slapping Google Play Error code: 505 on Android

Toronto, Ontario, Canada

We had a big updated recently. With this new release of the EatSleepRIDE app for Android, we were going FREE around the world and we were pumped. All the pieces were in place for a great week of downloads and the exhilarated and exhausted dev team was ready to breath a sigh of relief. That didn't happen.

We’d worked hard to improve the stability and we learned so much along the way. We were super stoked as a team for the new release and we were eager to see how people would react.

The great thing about developing an app for Android is the openness of the eco-system and (compared with Apple) how few rules there are. The downside is just how much can go wrong.

As the ESR app trickled out via the Play Store, the feedback trickled in from around the world. It was more stable, it ran faster and people liked it. Well, some people did. Some were completely pissed off! Upon browsing our Play Store page, excited riders were unable to download the ESR app, they were getting the hated "Error code: -505".

Error code: -505 caused the ESR app to be unavailable for download by riders around the world for almost 5 days

Error code: -505 caused the ESR app to be unavailable for download by riders around the world for almost 5 days

That’s pretty much all it says. No “Sorry, try again”. No, “Hey, this is something you need to look at”. Nope. Just that, simple, stark and dystopian "Error code: -505".

Now, we do rigorous testing on tens of handsets in various sizes, versions and states of repair for months and we had never once seen this problem! Moreover, because the ESR app wasn't installing, we weren't getting any logs that could help us understand the error. How do you debug something with no explanation, that happens to only some Android users and that you cannot replicate; not even once?

The first step is to Google it. Google would know, right? Nope. Almost all the information on the web simply states “something went wrong”. The general consensus is that it's related to upgrading the handset and not clearing caches and NONE of this information is from Google proper. Solutions range from “clear the play store cache” to “factory reset your device and cross your fingers”.

Then, like the sun clearing the rain in a mountain pass, I was fortunate - scattered among the usual comments like: “This is a piece of shit. I can’t even install it - 1 star” brigade, there were a few users ready and willing to help. But after creating a few builds, I was still none-the-wiser and so we finally resorted to asking users to side load using ADB.

The Fog Clears

Finally after help from a number of awesome motorcycle riders and Android users, an error message clearly emerged: INSTALL FAILED CONFLICTING_PROVIDER__. Oddly, we don’t use content providers at all, at least not that I am aware of. Surprisingly after more Googling and grepping the code, I discovered that we actually do.

In part of GMS 8.3 and onwards there’s a content provider named "AppMeasurement", which is signed at the package level. However, due to a bug in Gradle, it’s not able to get the name of the package. As a result, when installed, it conflicts with the very first thing installed that used GMS 8.3 or later, affecting a small number of users.

The solution, like most things in Android turns out to be one line of poorly documented code: in your Gradle file, define the applicationID in the defaultConfig.

This is the kind of bug I’ve come to expect: Android is complex. The irony is that these types of time suckers are so easily avoided by one simple strategy from Google. Give users and developers better error messages.

Better yet, Dear Google, please make error messages friendlier, and give the developers more detail via the Play Store. It’s clear the device knows what’s up because it’s not installing.

I’m sure Google get logs of what’s failing, so why can’t I?

I hate how one line of code can take over our lives, and that's why I wanted to share this. To help other developers save some time for video games and motorcycle roads. I hope this helps.

To the ESR app users who helped us track the elusive "Error code: -505" I say "thank you". And thank you to you too. To all the riders who support the mission to build the best motorcycle app on the planet. To all the riders that continue to help improve ESR and CRASHLIGHT® release after release.

We could truly not continue this work without you and we are grateful every day for those that join us in this journey. Thank you, thank you, thank you.

Now let's ride!

EatSleepRIDE Motorcycle GPS is the most advanced and comprehensive app for motorcycle riders.

You must be logged in to comment
Login now

alex

98 months ago

@macdracer thank you for the kind words. Much appreciated.

macdracer

98 months ago

@alex the dedication from you and the ESR team continues to amaze me. I'm not on Google, but I appreciate the effort that goes into making the app cross-platform. More riders, more fun regardless of the device you use. Thanks for all your hard work.

SuperchargeR

98 months ago

Hey @alex you and the ESR team do an amazing job. I ride alone alot and I feel safer riding with Crashlight. it's saved my ass at least once. Thanks for all the great support too. I'm waiting for the new features on android!

marina

98 months ago

Now back to Assassin's Creed Syndicate - that is until it's warm enough to ride.