mapbox-android-demo icon indicating copy to clipboard operation
mapbox-android-demo copied to clipboard

Update dependencies.gradle

Open oddlymagical opened this issue 5 years ago • 2 comments

Update MinSdkVersion to 21 for Firebase compatibility.

The demo wouldn't run, was crashing instantly. Finally was able to track down the problem:

2020-07-24 09:56:38.172 7186-7186/com.mapbox.mapboxandroiddemo.debug W/FirebaseApp: Default FirebaseApp failed to initialize because no default options were found. This usually means that com.google.gms:google-services was not applied to your gradle project.
2020-07-24 09:56:38.172 7186-7186/com.mapbox.mapboxandroiddemo.debug I/FirebaseInitProvider: FirebaseApp initialization unsuccessful
2020-07-24 09:56:39.109 7186-7186/com.mapbox.mapboxandroiddemo.debug D/FirebasePerformance: Creating a new Non Verbose Session: 3d30ae187e6f466cb1a086e72b140a86
2020-07-24 09:56:39.110 7186-7186/com.mapbox.mapboxandroiddemo.debug D/FirebasePerformance: Creating a new Non Verbose Session: 2d73f3685fe24cbabed9d08b3b4bbbb0
2020-07-24 09:56:40.022 7186-7186/com.mapbox.mapboxandroiddemo.debug D/FirebasePerformance: onResume(): com.mapbox.mapboxandroiddemo.account.LandingActivity: 1885247 microseconds

This post on Stack Overflow suggested that the MinSdkVersion needed to be at least 21, not 16. I made the change and everything worked.

oddlymagical avatar Jul 24 '20 17:07 oddlymagical

Thanks @brandihaskins. Can you say more about what device you're seeing the crash on and when the app actually crashes? You're unable to do a clean install on the device? It crashes when you try to log into your Mapbox account? When you try to open a certain example?

langsmith avatar Jul 24 '20 18:07 langsmith

@langsmith sure - sorry for not including more context. This is happening when trying to load the demo app onto an emulated device in Android Studio. It builds and installs without incident but when the app tries to launch it is just a brief flash on the screen. If you turn your head you can miss it.

I don't have a physical one to test with, but this was consistent across emulated nexus 6, galaxy s7, and pixel 3

Works perfect after changing the MinSdkVersion.

oddlymagical avatar Jul 24 '20 20:07 oddlymagical