title: How to use non-Nexus 5 emulators with Google Play Services dependency for my Google Maps app
body: <p>My testing approach involves using many emulators of various configurations (makes/models/dimensions/apis/targets).  </p>
  
  <p>I have recently upgraded to Android Studio 3.1.</p>
  
  <p>My app is going on 3 years now and uses Google Maps v2 and I'd like to keep maintaining it (Google laughs).</p>
  
  <p>Every emulator (other than the Nexus 5) I have now does not work because it says the Google Play Services needs to be updated and there appears to be no path to resolving it.  The Nexus 5 emulators don't have the error but display a blank map background.</p>
  
  <p>When I attempt to remove any dependency on Google Play Services it ends up being a slippery slope (mainly replacing the fused location service).</p>
  
  <p><strong>Question</strong>: If I have a Google Play Services dependency (my first mistake perhaps?) in my Google Maps v2 app am I limited to the Nexus 5 emulators (which seem to have its own issues)?  If not then how to upgrade the other fine emulators (Pixel, other Nexus, Galaxy...)? </p>
  
  <p>I see other questions out there and I'll continue staring at them but I'd like to understand what is a workable path for future maintenance - removing dependencies, upgrading something...</p>
  
  <p>For reference:</p>
  
  <p>The non-Nexus 5 relevant error is:</p>
  
  <blockquote>
    <p>(app) won't run unless you update Google Play services </p>
    
    <p>(A big fat
    'Update' button is also displayed which throws an exception -
    presumably because it is not installed on the emulator.)</p>
  </blockquote>
  
  <p>The Nexus 5 relevant error is:</p>
  
  <blockquote>
    <p>E/Google Maps Android API: Google Maps Android API v2 only supports
    devices with OpenGL ES 2.0 and above</p>
    
    <p>(Which I can't enable in the AVD manager for Nexus 5 emulators.)</p>
  </blockquote>
  
  <p>Here's some typical gradle madness - I was trying to bump play-services down to 11.8.0 and this unfortunate magic happens (from gradlew app:depencencies):</p>
  
  <blockquote>
    <p>+--- com.google.android.gms:play-services-maps:11.8.0 -> 12.0.1 |    +--- com.google.android.gms:play-services-base:12.0.1 |    |    +--- com.google.android.gms:play-services-basement:12.0.1 |    |    |<br>
    +--- com.android.support:support-v4:26.1.0 (<em>) |    |    |    --- com.google.android.gms:play-services-basement-license:12.0.1 |    |<br>
    +--- com.google.android.gms:play-services-tasks:12.0.1 |    |    |    +--- com.google.android.gms:play-services-basement:12.0.1 (</em>) |    |    |    --- com.google.android.gms:play-services-tasks-license:12.0.1 | 
    |    --- com.google.android.gms:play-services-base-license:12.0.1 |<br>
    +--- com.google.android.gms:play-services-basement:12.0.1 (*) |    --- com.google.android.gms:play-services-maps-license:12.0.1</p>
  </blockquote>
  
  <p><strong>Celebration</strong></p>
  
  <p>@xiaomi correctly attributed the problem to play-services (or specifically play-services-maps) 12.0.1 so after some gradle battles I bumped all play-* down to 11.8.0 and the non-Nexus emulators work.</p>
  
  <p>Lessons Learned:</p>
  
  <ul>
  <li><strong>Never blindly follow the gradle warning-advice to upgrade versions!</strong></li>
  <li>"gradlew app:dependencies" is your friend.</li>
  </ul>
  
  <p><strong>Epilogue</strong></p>
  
  <p>Think many times before following this:</p>
  
  <p><a href="https://i.stack.imgur.com/o6Y3l.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/o6Y3l.png" alt="enter image description here"></a></p>