2016-06-21 37 views
0

我正在構建的應用程序,包含地圖,當測試有Android操作系統版本6 HTC設備上,地圖上沒有顯示谷歌地圖有Android操作系統版本6

它任何一個可以幫助我好嗎?

+1

您的設備是否已經安裝了谷歌播放服務? –

+0

是的,它可以安裝,我可以打開谷歌播放和谷歌地圖,也可以接收推送通知。 –

+0

我們可以在地圖不顯示的情況下截取片段嗎?並詳細記錄活動日誌,詳細模式 –

回答

0

檢查是否安裝了Google Play服務,並檢查SHA鍵是否正確.Google地圖不是特定於設備的。

0

地圖沒有顯示

原因可以是下列之一:


public static boolean isGooglePlayServiceAvailable(Activity context) 
{ 
      GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance(); 
     int resultCode = apiAvailability.isGooglePlayServicesAvailable(context); 
     if (resultCode != ConnectionResult.SUCCESS) { 
      if (apiAvailability.isUserResolvableError(resultCode)) { 
       apiAvailability.getErrorDialog(context, resultCode, PLAY_SERVICES_RESOLUTION_REQUEST) 
         .show(); 
      }else{ 
       Toast.makeText(context, "This device is not supported. Google Play Services not installed!", Toast.LENGTH_LONG).show(); 
       return false; 
      } 
     }else{ 
      return true; 
     } 
     return true; 
} 

  • 另一個原因可能是應用程序具有在AndroidManifest

API KEY的錯誤 gcm_defaultSenderId或錯誤的價值觀
<meta-data 
      android:name="com.google.android.maps.v2.API_KEY" 
      android:value="A****************************E" />