Hey hai I am not able to get the maps loaded on my phone I get a error cannot open file for reading I have added google play service as library project; I have also added google play services jar to my project
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mapsdemo"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="15" />
<permission
android:name="com.example.mapsdemo.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.mapsdemo.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"/>
<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.mapsdemo.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="API KEY"/>
</application>
</manifest>
my main.xml file
<?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"
class="com.google.android.gms.maps.MapFragment"/>
my MainActivity.java
package com.example.mapsdemo;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.app.Activity;
public class MainActivity extends Activity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
When I run this on my galaxy s3 which has Android 4.0.4 The log cat gives me an error :
Log cat
01-25 20:11:45.690: E/(23663): Can't open file for reading
01-25 20:11:45.690: E/(23663): Can't open file for reading
Please help out with this
Oh my god..your "my MainActivity.java" is wrong. You did not write anything in it, so you get the failed. To display Google maps, AT LEAST your java code MUST include the following code, which is basic and initial settings;
1.**Modify your " **my MainActivity.java" such like as below;
This shows how to create a simple activity with a map and a marker on the map. Notice how we deal with the possibility that the Google Play services APK is not installed/enabled/updated on a user's device.
public class MainActivity extends android.support.v4.app.FragmentActivity {
private GoogleMap mMap;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.basic_demo);
setUpMapIfNeeded();
}
#Override
protected void onResume() {
super.onResume();
setUpMapIfNeeded();
}
private void setUpMapIfNeeded() {
// Do a null check to confirm that we have not already instantiated the map.
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
// Check if we were successful in obtaining the map.
if (mMap != null) {
setUpMap();
}
}
}
private void setUpMap() {
mMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
}
}
2.**After modifying, press **ctrl+shft+ alphabet "o" on your keyboard and save it, Run again~!.
NOTE:Before you run, you MUST set the build target as "Googel APIs" in Android 4.0.3, NOT Android 4.0.3 in eclipse. Please check it; project < properties < Android < select "Googel APIs" under Android 4.0.3,
This error message is apparently a side-effect on the Samsung Galaxy S3 that occurs when you don't register the SHA-1 fingerprint of the digital certificate you're using to sign the Android application with the Google APIs console for the Android Maps API V2.
For example, I got this same error:
Log cat 01-25 20:11:45.690: E/(23663): Can't open file for reading
...after I switched to a new laptop and forgot to add the SHA-1 of the new debug certificate on that laptop to the Google APIs console.
To fix this on Windows for the debug certificate, open the command prompt, and then:
cd .android
keytool -list -alias androiddebugkey -keystore debug.keystore -storepass android -keypass android -v
This will print out a bunch of text, and you'll want to copy the text after the SHA-1: output.
Then, follow the instructions in the Android Maps API V2 documentation to add your SHA-1 fingerprint followed by a semicolon and your app package name to the Google APIs console.
Related
I have read all the similar questions and did everything that was described in them, but did not help.
Google Maps API v2 is Enabled and
API key is correct
I just chose GoogleMapsActivity in "New project", then created a key.jks, created sha1 by keytool, created public api access key, put my API key in manifest.
I tried:
clean-rebuild-unistall app-install
updated api key many times
create a new project with the new key.jks (and all over again)
delete and create api key
Here is my manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dandewine.user.thinkmobiletest" >
<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" />
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but are recommended.
-->
<application
android:allowBackup="true"
android:icon="#mipmap/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="AIza**************************" />
<activity
android:name=".ActivityMain"
android:label="#string/title_activity_activity_main" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
Here is my activity:
public class ActivityMain extends FragmentActivity implements OnMapReadyCallback {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_map);
SupportMapFragment mapFragment = (SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(this);
}
#Override
public void onMapReady(GoogleMap googleMap) {
googleMap.addMarker(new MarkerOptions()
.position(new LatLng(0, 0))
.title("Marker"));
}
Logcat:
E/Google Maps Android API﹕ Authorization failure. Please see https://developers.google.com/maps/documentation/android/start for how to correctly set up the map.
07-27 14:52:37.551 25002-25035/com.dandewine.user.thinkmobiletest E/Google Maps Android API﹕ In the Google Developer Console (https://console.developers.google.com)
Ensure that the "Google Maps Android API v2" is enabled.
Ensure that the following Android Key exists:
API Key: AIza****************************
Android Application (<cert_fingerprint>;<package_name>): 8C:2B:4C:F7:CF:FB:EC:D5:DC:D7:D0:5D:6E:30:49:74:97:18:57:88;com.dandewine.user.thinkmobiletest
UPDATE: I have different SHA1 fingerprints in google dev. console and in logs, how to deal with that?
Can anyone help with advice.
It sounds like you're using the SHA1 fingerprint from the keystore that you will be using to generate a signed apk.
For debugging/running from Android Studio, you need to use the SHA1 fingerprint that Android Studio uses to sign the apk.
Note that you can get this SHA1 fingerprint by using command line:
For Mac or Linux:
keytool -list -v -keystore ~/.android/debug.keystore
For Windows:
keytool -list -v -keystore C:\User\YourUser\.android\debug.keystore
with password "android".
However, since you already have the correct value in your logs,
just copy this from your logs (I modified it here, don't copy from here):
8C:2B:4C:F7:CF:FB:EC:D5:DC:D7:D0:5D:6E:30:49:xx:xx:xx:xx:xx;com.dandewine.user.thinkmobiletest
And paste that into your API Key in the developer console.
You can add multiple fingerprint/package values to each API key, one per line (you can also see that in the instructions when you are editing an API key).
You can also configure a different API key for debug and release, if you do that take a look at this answer.
add the following in manifest:
<permission
android:name="com.dandewine.user.thinkmobiletest.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.tp.lib.tp.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
also:
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
Check if you have included your signature key in debug and release mode, read this: http://developer.android.com/tools/publishing/app-signing.html#cert
I trying to build a simple pedestrian dead reckoniing app using google map v2. But always got error 'Authorization failure' and 'could not contact google server'. I already check the api key, enable the 'Google Maps Android v2' service in Google API console, and allow my apps to use the API. but still not work.
Here's my manifest :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.pdr"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<permission
android:name="com.example.pdr.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.example.pdr.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_NETWORK_STATE"/>
<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.pdr.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>
<activity android:name="com.example.pdr.MapActivity"></activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCu0QDFkPWOOAr0PACX2AUSSGkPWYmdpr0"/>
</application>
</manifest>
Here's the activity that using the map
public class MapActivity extends FragmentActivity {
private MapView map = null;
private GoogleMap gMap;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_menu);
setUpMapIfNeeded();
};
#Override
protected void onResume() {
// TODO Auto-generated method stub
super.onResume();
setUpMapIfNeeded();
}
private void setUpMapIfNeeded() {
if (gMap == null) {
gMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
}
}
private void setUpMap() {
gMap.addMarker(new MarkerOptions().position(new LatLng(0, 0)).title("Marker"));
}
}
And finally, here's the layout :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".MapActivity" >
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="#+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment"/>
</RelativeLayout>
Can anybody please help me ? I've been struggling for days..
Thanks in advance, and sorry for my english...
This problem is related to your api-key generation process. Please follow below mentioned steps to generate key-
1. generate SHA-1 using keytool.
2. open google console on browser, dont forget to enable Google Maps Android API v2 from sevices, now go on API Access, click on create new Android key, paste your SHA-1 along with semi-colon and your project package name then click on create,
3. copy the new API-key and paste in your manifest.
4. Most important, dont forget to import google play service lib from extras folder of sdk if already installed, Otherwise go to Android sdk-manager -> extras->google play service, make it installed then import from your sdk location->extras->google-> google play service.
5. Now add this lib to your working project.
This is the whole process to execute google maps android v2.
Now you can run your project, cheers......
I'm trying to use mapviews in an app, so I followed the steps one by one. But I got just a gray grid. I generated the API key four times, but get the same result every time.
could you please help me?
These are the errors I got:
failed to find provider info for com.google.settings
couldn't get connection factory client
my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.me.test.g_maps"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="7"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="com.me.test.g_maps.permission.MAPS_RECEIVE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<permission
android:name="com.me.test.g_maps.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<activity
android:name="com.me.test.g_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>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyCEgLQ7HgXiKTP8grZRmpIPAeWoSfAjrBM"/>
<uses-library android:name="com.google.android.maps" />
</application>
</manifest>
my activity
package com.me.test.g_maps;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class MainActivity extends MapActivity {
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
#Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}
my xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<com.google.android.maps.MapView
android:id="#+id/mapView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:enabled="true"
android:clickable="true"
android:apiKey="AIzaSyCEgLQ7HgXiKTP8grZRmpIPAeWoSfAjrBM"
/>
</RelativeLayout>
As it looks you have few problems (in case your targeting Google Map API V2 technology)
1. First of all remove this permission:
<uses-library android:name="com.google.android.maps" />
It's a part of Google Maps API V1 and is not needed in Google Maps API V2.
2. Google Maps API V2 needs OpenGL-v2 support, and therefor you have to add the following to your manifest file:
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
3. Check that you are turning on the right API in the Google API Console:
4. Try to regenerate the key again, by deleting the debug.keystore, compiling a project and that will result in a new SHA1 signature.
5. If you run your application in the emulator, check this blog post I wrote on how to enable Google Map API V2 in the emulator:
Google Map API V2 in the Emulator
If you are using Google api V1, you have to create a debug key to load correctly the map when you are debugging the app without signing it.
Else, you have to take a look here. New configuration on manifest is needed to use google maps api V2.
Replace com.google.android.maps.MapView with com.google.android.gms.maps.MapView. You are still using parts of Maps API V1. And it's better (easier) to use SupportMapFragment instead of MapView.
And don't use MapActivity either.
I am trying to release my app, but having a problem with google maps.
The app contains an activity (MapActivity) that displays a map. When running in debug mode, the map works fine.
I signed my app in release mode, and got SHA1.
I created a new android key on Google console as required (SHA1;packageName). Got the API Key
In my App, I referenced a copy of google-play-services-lib as required.
I am using ADT.
map.xml
<?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" />
MapActivity.java
public class MapActivity extends FragmentActivity {
private GoogleMap map;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.map);
map = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map))
.getMap();
}
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.rentalcar"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<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-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="com.example.rentalcar.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.example.rentalcar.permission.MAPS_RECEIVE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
>
<activity
android:name="com.example.rentalcar.MainActivity"
android:label="#string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.example.rentalcar.MapActivity"
android:label="#string/title_activity_map"
android:screenOrientation="portrait" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="My_Key"/>
</application>
</manifest>
The only weird thing is that when I use keytool to get SHA1 I get "Signature Algorithm name: SHA256withRSA. can this be the problem? If yes, how can I change it?
I am kind of stuck here! Thank you for any help!
if you already tried #Budius answer and still facing this error, it might be caused by the following situation:
When you add your MapFragment, Android Studio create 2 files google_maps_api.xml: one inside src/debug/res/values folder and the other inside src/release/res/values.
But for some reason only the debug folder file is showed on Android Studio. So, when you change the APIkey value, it is done only at debug folder file.
So just copy the google_maps_api.xml file to release folder and assure that both are with same APIKey.
this worked for me after all other attempts.
in the map API V2, the ONLY thing that change between a release version and a debug version is the Key that you register here https://code.google.com/apis/console/
If debug is working and final release is not, it's the only change necessary.
So I suggest you to double check the hash code of your release keystore and make sure that it's properly input on the Google API Console.
I was also facing the same problem since last few days and it took me around 2-3 days to figure out the problem.
You need to add your API key at 2 places one in
app/src/debug/res/values/google_maps_api.xml and other in app/src/release/res/values/google_maps_api.xml.
You can find the release/google_maps_api.xml in the project mode not in the Android/application mode.
I had the same problem... I've found the gogole_maps_api.xml file into the release/res/values folder... But inside the API_KEY was empty!!!!
After copying the API key also here, all works perfectly in debug mode and also in release!!
Thanks Sumit Sinha for suggestions
I'm facing same problem,
map work on debug but it's not working on Google Play Store
Try this:
I solved by add SHA1 key from Google play store to APIkey google maps console
or you can open this:
https://github.com/react-native-maps/react-native-maps/issues/327
Just clear data (Setting->App-select app-Clear data->uninstall) and try. this worked for me.
Ensure that package name is same as that in google developer console.
if you are created SHA1 code from custom keystore use the same in release mode. or generate apk by signing with that same keystore.
1- Create apk file using "Use the export Wizard" in "Android Manifest" file of your project.
2- After inserting key and before finishing, MD5 and SHA1 keys are shown as shown is this given pic-
3- Create new API Key for Android project for new SHA1 which is retrieved in point 2.
4- Use that API key in manifest file as shown below
5- Clean your project and build APK file again.
6- You can see google maps now in that apk.
I was following everything yet was not able to get it done, the thing I was doing wrong is that
I was initially **checking ** both V1 and V2 signature versions.
Solution: Just check the V1 Signature
It's been a while, but I've found a very easy solution.
Just set gradle like this:
buildTypes {
release {
isMinifyEnabled = false
isShrinkResources = false
}
}
I'm using maps api v2 in android app that supports 2.3.3, and I set setMyLocationEnabled(true), of course I have my button which works fine on jelly bean, but not working on 2.3.3.
here are how I called the map :
private void setUpMapIfNeeded() {
// Do a null check to confirm that we have not already instantiated the map.
if (mMap == null) {
// Try to obtain the map from the SupportMapFragment.
mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap();
// Check if we were successful in obtaining the map.
if (mMap != null) {
setUpMap();
}
}
}
private void setUpMap(){
mMap.setMyLocationEnabled(true);
if(ttdBranch!=null){
mMap.addMarker(new MarkerOptions()
.position(new LatLng(ttdBranch.getLatitude(), ttdBranch.getLongitude()))
.snippet(getResources().getString(R.string.branch) + "\n" + ttdBranch.getName()));
LatLng pos = new LatLng(ttdBranch.getLatitude(),ttdBranch.getLongitude());
mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(pos, 14));
}
}
here's manifest :
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="17" />
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<permission android:name="*******.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<uses-permission android:name="*******.permission.MAPS_RECEIVE"/>
<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.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:allowBackup="true"
android:icon="#drawable/ic_ttd_petales"
android:label="#string/app_name"
android:theme="#style/Holo.Theme.Light" >
<activity
android:name="*******.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>
<activity android:name="*******.BranchesMapActivity" />
<activity android:name="*******.BranchDetailActivity"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="*******"/>
I maked sure that location sensor is enabled on the phone, and it's workin on Google Map app, but not in my app.
Any help ?
Thanks.
Please check this below..
1.check if the "libs" folder containing the "android-support-v4.jar" exists in your project.
"android-support-v4.jar" is located in "/extras/android/compatibility/v4/android-support-v4.jar" under your "android-sdk" drectory.
"The Google Maps Android API requires API level 12 or higher for the support of MapFragment objects. If you are targeting an application earlier than API level 12, you can access the same functionality through the SupportMapFragment class. You will also have to include the Android Support Library." is described in this Android Development Guide(click here).
2.Before running your project, you must set your project Build target to "Google APIs", not Android x.x. version :
Select your project and click Project > Properties > Project Build Target in Eclipse and select any "Google APIs ", and then run your project on your real phone(handset). If you use the emulator, you will get the failed result because the app with the Google Play Service library is not supported in the emulator.
"Google Play services is not supported on the Android emulator — to develop using the APIs, you need to provide a development device such as an Android phone or tablet." is described in in this Android Development Guide(click here).
3.Once more, you don't need to create the new Google Maps API key in order to test your project, Just use the default provided API key, which is shown as "Key for browser apps (with referers) "in your Google APIs Console.
4.Finally, the most important is to add Google Play services as an Android library project as follows:
Select File > Import > Android > Existing Android Code Into Workspace and click Next. Select Browse..., enter /extras/google/google_play_services/libproject/google-play-services_lib, and click Finish.
I hope my comment will be useful to you.