Google Maps doesn't load map's images - android

I implemented an example of android app with google maps, but the map hasn't been correctly loaded. When I zoon in the map gets blur and doesn't load the streets or any other details.
The logcat continuously shows the following message:
11-25 00:17:09.657: D/REQUEST(1485): Connection opened to:https://clients4.google.com/glm/mmap/api
11-25 00:17:09.663: D/REQUEST(1485): Open Connection
11-25 00:17:09.932: D/REQUEST(1485): DRD(60): 62|147
11-25 00:17:09.948: D/REQUEST(1485): Close
11-25 00:17:09.950: D/REQUEST(1485): Error processing: com.google.maps.api.android.lib6.b.d#2c85fd8f not retrying
I'm running the app with the android emulator with the following characteristics:
Device=Nexus S(4.0", 480x800: hdpi)
Target=Google APIs (Google Inc.) - API Level 17
CPU/ABI: Google APIs ARM (armeabi-v7a)
I already checked my API KEY and it's ok with the Google Developers Console. The SHA-1 key on my debug.keystore is exatcly the as the one on Developers Console, as well as the app package.
I saw a question here in the StackOveflow (http://bit.ly/1xVvo5D) that suggest to remove the following line HttpsURLConnection.setDefaultSSLSocketFactory(sslContext.getSocketFactory());. However, as far as I know I'm not using such code. Just to double check, I searched for HttpsURLConnection with eclipse Ctrl+H and nothing was found.
The manifest is:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.myapp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- External storage for caching. -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- My Location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<!-- Maps API needs OpenGL ES 2.0. -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my-api-key" />
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:exported="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
The main activity is:
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="#+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.SupportMapFragment"/>

Related

MAPS API - application not running on the emulator

I'm verry new at android developement , i'm trying to make a map application but can't even show a simple map on a fragment .
I've followed many & many tutorials , search a lot of answers in stackoverflow but still can't get the result i want .
I'm developping in eclipse and running app in emulator , i created a list of emulators to test on them but no one could show me the Map fragment.
The current AVDs that i have now are:
NEXUS S with ARMEABI V7 image system API 22
NEXUS S with Google API's intel Atom 86 API 22
Google NEXUS S with Google API's ARM API 22
All theese 3 don't have google play services and can't even install it on them (the tutorials i've watched not worked).
The last AVD that i could install Google play services in is the NEXUS S with ARM v7 image system API 17, i've google play services 12-5-18-000300-188802357 working fine and i've installed googleFrameWork and google play store(keep crashing even when update it )
The continious message i'm getting in this later is "Google play services are updating" ,everytime i try update the google play services , the app crash and stopped immediately .
This is my Manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.algerlasmart"
android:versionCode="1"
android:versionName="1.0" >
<permission android:name="com.exemple.algerlasmart.permission.MAPS_RECEIVE"
android:protectionLevel="signature">
</permission>
<uses-permission android:name="android.permission.ACESS_NETWOK_STATE"/>
<uses-permission
android:name="com.exemple.algerlasmart.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.READ_LOGS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission
android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="27" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"
/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
android:name="android.support.multidex.MultiDexApplication"
>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBBu2eJ-fSdlwUI9dPJhlbxK0emspboplQ"/>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<activity
android:name=".MainActivity"
android:label="#string/app_name"
android:configChanges="orientation|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".MainInterface"
android:label="#string/dashboard"
android:configChanges="orientation|screenSize">
</activity>
<activity
android:name=".GetContact"
android:label="#string/dashboard"
android:configChanges="orientation|screenSize">
</activity>
<activity
android:name="com.exemple.fragments.Dummy"
android:label="#string/dashboard"
android:configChanges="orientation|screenSize">
<intent-filter >
<action android:name="com.exemple.fragments.Dummy"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
</application>
</manifest>
The Google play services library i've used is lib for API 22 (not worked) and i downgrade to lib r18 (old from google's repôsitories).
the XML file of my map is the following:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/arroundMeLay"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<TextView
android:id="#+id/libele"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<fragment
style="#style/mapViewStyle"
android:layout_width="match_parent"
android:layout_height="200dp"
class="com.google.android.gms.maps.MapFragment" >
</fragment>
</LinearLayout>
Please i've spend over a month stucking at these problems .
NOTE : i've tried every time to update ,upgrade , downgrade SDK but still no answer or solution worked for me .

Android application not loading map view

Hi I am developing simple android application in which I am using android mapV2. So on Google API console I created one project after than I created new key for my application. So my application manifest looks like :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.maptestapp"
android:versionCode="1"
android:versionName="1.0" >
<permission
android:name="com.example.maptestapp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.maptestapp.permission.MAPS_RECEIVE" />
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<activity
android:name="com.example.maptestapp.MainActivity"
android:label="#string/app_name"
android:theme="#style/AppBaseTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Goolge API Key -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyC7945EdDYMoMHZAYNvNXbVSl1NSZrWCfs" />
</application>
</manifest>
So I am defining permissions and also defined meta data. and In layout I am trying to display
<fragment
android:id="#+id/map"
android:name="com.google.android.gms.maps.MapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
Now I tried to display my activity it shows me following error :
12-24 22:59:54.345: E/Google Maps Android API(28739): Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
12-24 22:59:54.345: E/Google Maps Android API(28739): Ensure that the following correspond to what is in the API Console: Package Name: com.example.maptestapp, API Key: AIzaSyZAYNvNXbVSl1NSZrWCfs, Certificate Fingerprint: 096388A528A6F8347914D
Its not rendering any map view. Need help. Thank you.
please try the link below which show step by step description ,which show how to use google map v2.Try this
Your API key is wrong. The error explains exactly what you need to do:
Please see
https://developers.google.com/maps/documentation/android/start
for how to correctly set up the map.
Ensure that the following correspond to what is in the API Console:
Package Name: com.example.maptestapp,
API Key: AIzaSyZAYNvNXbVSl1NSZrWCfs,
Certificate Fingerprint: 096388A528A6F8347914D

Android mobile device not showing in my eclipse browser

While I am trying to run Google Maps type apps I try to run using my android device. But device is not showing in my eclipse browser. What should I do ?
Is there any alternate way to run these type of applications ?
my menifest file as below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemaps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Required to show current location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- Required OpenGL ES 2.0. for Maps V2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<!-- Requires OpenGL ES version 2 -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.googlemaps.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="my key" />
</application>
</manifest>
Please Share what you have tried?
where you have to run this Application?
Please check Right click on the project->Run As->Run Configuration Now one window will show..That contains three tabs like Android,Target,Common.
1.You should select Launch default Activity in android tab
2.You should Select Automatically pick compatible Device
Ple try it
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="16" />
Ple Check this lines from Your manifest flie.. android:minSdkVersion="12" know..For Your Mobile Should not Greater than from 12.Please Check
This worked for me:
Create an apk file with same keystore key you have stored into Google Maps Console and install into your device. Installing into Android device using eclipse will not take your correct SHA1 key to view the Google Maps. As incorrect SHA1 key will lead to authentication failure.
vKj

Android Map issue

I am trying to make a simple app that uses map.after doing all coding map in not visible in output.only a zoomin and zzomout button is visible
below is manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.map1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="18" />
<permission
android:name="com.example.map1.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.map1.permission.MAPS_RECEIVE"/>
<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" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.map1.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBoSLfTOWdAny2vrtwMx6lFTuWdoyANJlQ"/>
</application>
</manifest>
below is xml file
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:id="#+id/the_map"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"
map:cameraTilt="45"
map:cameraZoom="14"
/>
I am testing my app on htc 1x.
here is logcat
08-27 00:24:10.419: I/(3812): Loading GLESv1_CM implementation /system/lib//egl/libGLESv1_CM_tegra_impl
08-27 00:24:12.284: I/Google Maps Android API(3812): Failed to contact Google servers. Another attempt will be made when connectivity is established.
08-27 00:24:27.739: E/Google Maps Android API(3812): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
It seems you have not added the play services to your project
You should reference the library project in your android map project.
http://developer.android.com/google/play-services/setup.html
Refer to this answer for more help on how to add play-service lib to your project
https://stackoverflow.com/a/18450128/826657
Are you using camera??, I get this error when use the camera and google map at the same FragmentActivity.
If i comment the camera code no gets errors, but when i activate this code, google the map is white and log says this:
03-03 13:42:39.721: E/SurfaceTexture(7327): [unnamed-7327-0] updateTexImage: error binding external texture image 0xafc9ec8a (slot 1): 0x502
Only on my HTC ONE X (nvidia tegra)

Google Map Api v2 without map view

I have followed this tutorial and I taked this ... without any error in Logcat view,If you have any idea about this error.
Thanks
I post to you my manifest code :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.maps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.example.maps.MainActivity"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<!-- Add Api key -->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyAmklok-bwsgXzYLyBl4jLxFY3Gs6198YA" />
</application>
<!-- add Permisson -->
<permission
android:name="com.example.maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.maps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<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" />
<!-- autres configs -->
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
</manifest>
All steps in many tutorials have a same code , I Think a problem is in emulator .
Google Map Api v2 wont show the map if you try to run it in Emulator or Device.
In order to show Map you need to sign the Application and then through command prompt try to install your application. Hope you will be able to get Map.
Few Steps required:-
1) You need add Libray project to your application
adt-bundle-windows-x86_64-20130219\adt-bundle-windows-x86_64-20130219\sdk\extras\google\google_play_services\libproject
Hope this will help you.
From the tutorial i read from this http://agusharyanto.net/wordpress/?p=893 from indonesia, you must use the google service library on the Google API that you choose and use another application venton.apk and gms.apk from adb command. If you dont understand the languages, try understand by look at the image explanation.

Categories

Resources