Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google maps not showing all of a sudden in Android

I am currently developing an application in Android that uses Google maps. I have followed all the instructions like

  • Including the google play services dependency to my project
  • Downloading google play services in Android SDK
  • Creating an Android key from google developers console.
  • giving the necessary permissions

The google maps were showing up normally as expected until suddenly a black screen starts appearing now.

I get the following lines on logcat.

W/ResourcesManager﹕ Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.

W/ResourcesManager﹕ Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.

I/Google Maps Android API﹕ Google Play services client version: 6587000

I/Google Maps Android API﹕ Google Play services package version: 6774436

This is the dependency I have in my build.gradle file

compile 'com.google.android.gms:play-services:6.5.87'

How do I resolve this issue? Is it due to some update to the google play service? If so I have checked the SDK and I have the latest Google play service installed. Kindly help anyone

Here is the log cat

02-19 13:53:01.212  14731-14749 D/OpenGLRenderer﹕ Render dirty regions requested: true
02-19 13:53:01.218  14731-14731 D/Atlas﹕ Validating map...
02-19 13:53:01.292  14731-14749 I/Adreno-EGL﹕ <qeglDrvAPI_eglInitialize:410>: QUALCOMM Build: 10/03/14, c40da3f, Ifda814c646
02-19 13:53:01.293  14731-14749 I/OpenGLRenderer﹕ Initialized EGL, version 1.4
02-19 13:53:01.311  14731-14749 D/OpenGLRenderer﹕ Enabling debug mode 0
02-19 13:53:04.472  14731-14731 I/x﹕ Making Creator dynamically
02-19 13:53:04.477  14731-14731 W/ResourcesManager﹕ Asset path '/system/framework/com.android.media.remotedisplay.jar' does not exist or contains no resources.
02-19 13:53:04.478  14731-14731 W/ResourcesManager﹕ Asset path '/system/framework/com.android.location.provider.jar' does not exist or contains no resources.
02-19 13:53:04.503  14731-14731 I/Google Maps Android API﹕ Google Play services client version: 6587000
02-19 13:53:04.515  14731-14731 I/Google Maps Android API﹕ Google Play services package version: 6774436
like image 591
Viswanth Avatar asked Feb 19 '15 15:02

Viswanth


2 Answers

Try these things if your code does not have these:

  • Try adding android:name="com.google.android.gms.maps.SupportMapFragment" to your fragment.xml.

  • Try using extend Fragment instead of extend SupportMapFragment.

  • onMapReady() is triggered by a call to getMapAsync() on your MapFragment be sure to have that.

  • Also check your manifest file if it lacks some permissions

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    
    <permission
    android:name="your.package.name.permission.MAPS_RECEIVE"
    android:protectionLevel="signature" />
    <uses-permission android:name="your.package.name.permission.MAPS_RECEIVE"/>
    <uses-feature
    android:glEsVersion="0x00020000"
    android:required="true"/>
    

Post your log cat so that the exact cause may be found out!!

like image 195
AniV Avatar answered Nov 01 '22 14:11

AniV


  • remove following import from the list and corresponding methods

    import android.location.LocationListener;
    
  • instead use Location listner from the Google API class and change your interface to complete namespace instead com.google.android.gms.location.LocationListener

For example if you are deriving from interface check text in BOLD

public class Option extends FragmentActivity implements View.OnClickListener, ConnectionCallbacks, OnConnectionFailedListener, LocationSource, com.google.android.gms.location.LocationListener, OnMyLocationButtonClickListener, OnMapReadyCallback {

If do not give complete namespace by default compiler takes Android standard LocationListner and gives error.

like image 26
Ashish Gupta Avatar answered Nov 01 '22 16:11

Ashish Gupta