To add Google Maps to your android application, you need to include a few permissions:
<!-- Required -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<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"/>
<!-- Optional -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
However, by checking Google Maps Android API v2 documentation again, I noticed that
com.google.android.providers.gsf.permission.READ_GSERVICES
is no longer required. I tested it by removing it from AndroidManifest.xml and the map is loading fine without any problems.
So, my question is.. what is/was the purpose of READ_GSERVICES permission?
Note: Even though it is removed from Google Maps Android API v2 documentation, it can be found on
Google Maps API for Business documentation.
All permissions you need for Google Maps Android API are in the docs:
You must also request the android.permission.WRITE_EXTERNAL_STORAGE permission.
Note: If you're targeting the Android M SDK (23) and the latest version of the Google Play services SDK (8.1), you no longer need the WRITE_EXTERNAL_STORAGE.
From the next release of the Google Play services SDK, the requirement for the WRITE_EXTERNAL_STORAGE permission will be completely dropped from the Google Maps Android API.
So the answer is NO, you don't need it if you use current latest GPS, i.e. 8.1.0.
NO, This persimmons is no longer required in google MAP API V2
<permission
android:name="phonelocation.example.asuss550c.phonelocation.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
You only need to add
<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" />
Also this MetaData in your Application Tag
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="#string/google_maps_key" />
Related
I have removed sms and call log permissions from my app and using alternatives to common uses that is using share intent and dial intent. But I am still getting the same warning in the play console on my application. following is the list of permissions in my app.
<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_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS"
tools:ignore="ProtectedPermissions" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Push Notification Permission -->
<uses-permission android:name="com.onwaycab.permission.C2D_MESSAGE" />
<uses-permission
android:name="com.google.android.c2dm.permission.RECEIVE"/>
<!-- MAP Permission -->
<permission
android:name="com.onwaycab.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.onwaycab.permission.MAPS_RECEIVE" />
Edit:
I am receiving the warning even if I have not used sms and call log permission so it is not duplicate of that question.
If you are seeing this alert every time you refresh the page, then one or more your libraries might be using the permission.
To check all permissions your app is using, just install the app on the real device and check the App Info - Permissions.
Alternatively, add this to your Manifest file. tools:node="remove" will remove the permission in case if any library is requesting it.
<uses-permission android:name="android.permission.READ_CALL_LOG" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_CALL_LOG" tools:node="remove" />
Another important point, if you are using build variant then define it inside your highest priority manifest file.
Library manifest: lowest Priority
Main manifest: Medium Priority
Build Vairant manifest : Highest priority
My playstore console showed this "SMS & CALL_LOGS" related warning.
So, I removed the SMS & CALL_LOGS related permissions from the manifest and uploaded the latest release build to playstore. But the warning was still shown to me after latest build was published on store.
So ,After this I filled this below Permissions declaration form and the warning is removed now.
https://docs.google.com/forms/d/e/1FAIpQLSfCnRaa4b1VuHhE4gVekWJc_V0Zt4XiTlsKsTipTlPg5ECA7Q/viewform
Another thing worth checking - we had an old Beta version of the app that did use SMS in the Google Play Console on Release management -> App release.
The Beta wasn't active any more but that old version was still showing under Release management -> Artifact library-> Active artifacts, so am guessing Google still considered it an active application. Helpfully this area also shows you all the permissions your app uses, in case you are concerned if a library or plugin is adding permissions without your knowledge.
Removing the Beta version and appealing the removal as it being due to an inactive Beta, got the app republished within a few hours.
I have the below permissions defined in the Manifest but I still see Android asking the app needs permission to write to External storage even though I don't want to access External Storage
Could it be because of Google Play services
<uses-permission android:name="android.permission.INTERNET" />
<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-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
Pls try This for google play service error:
<uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="Version code" />
Metadata used end of application.
It's almost a year since post publication but maybe this'll help someone.
If you are using play-services version < 8.3 then play-services-maps uses this permission.
If you are not using play-services-maps then probably you are using play-services-fitness which takes maps as transitive dependency.
If you are not using nor of them, then probably you have other transitive dependency which needs this permission.
TIP to check transitive dependencies
Add these permissions
<uses-permission android:name="ANDROID.PERMISSION.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="ANDROID.PERMISSION.WRITE_EXTERNAL_STORAGE"/>
This might be because of below two reason.
If you're targeting version 8.3 or later of the Google Play services SDK, you no longer need the WRITE_EXTERNAL_STORAGE
permission to use the Google Maps Android API.
If you're targeting earlier versions of the Google Play services
SDK, you must request the
android.permission.WRITE_EXTERNAL_STORAGE permission.
Check this link.
There was a bug in Google play services that causes unintended WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE, and
READ_PHONE_STATE permissions to be merged into app manifests. That
is solved in Google Play services 10.0 release. Check this.
To avoid this I recommend to include necessary individual Play service APIs and corresponding build.gradle descriptions. Check this.
Hope this will help you and future user also.
This is missing :
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
I'm uploading an App to Google Play and there is about 2321 devices not compatibles with it. In order to test it I have setted all uses permissions to false (except openGl, for Maps V2). I'm using a lot of permissions but, for example, as far as I know Sony ST21 (http://www.gsmarena.com/sony_xperia_tipo-4718.php) has all my required features.
This are my required permissions (from Google Play):
android.hardware.CAMERA
android.hardware.camera.AUTOFOCUS
android.hardware.LOCATION
android.hardware.location.GPS
android.hardware.location.NETWORK
android.hardware.TOUCHSCREEN
And this are my permission inside Manifest:
<permission android:name="com.zonaapp.flamencomovil.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<uses-permission android:name="android.permission.CAMERA" />
<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" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="com.zonaapp.flamencomovil.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
Whats wrong with my Manifest Configuration?
Check your min and max SDK version, those 2321 devices not compatibles with it may goes out of of your min & max sdk version.
So, provide min SDK version as below as and instead of max SDK or target SDK version provide latest android version.
Then it will cover lots of devices.
This has nothing to do with your permissions, you need to check the value of minSdkVersion in your manifest file. If it is very high, then many devices running older versions of Android won't support your app.
I'm trying to test Gmaps example of Android developer from Android SDK Manager.
The Google Play Service was imported as a Library.
The libs folder was cleaned from the library project;
The maps sample was imported;
In project properties --> Android, I have the following configs:
Google API's instead of standard Android;
Library --> Google play services is green.
The errors that are presented:
The import com.google.android.gms.location cannot be resolved
The method setImage(BitmapDescriptor) is undefined for the type
GroundOverlay
The method flat(boolean) is undefined for the type MarkerOptions,
and others methods undefined.
I'm newbie in Android development, so.. what is wrong?
Could someone help me with this? Thanks.
Have you made changes in your manifest?What about the key which is to be registered in Google console and is to be declared in the manifest file?
Some permissions need to be declared in the manifest file like:
<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="com.example.gps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
and the key is to declared in meta data:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="your key value" />
I'm currently working on getting an old Titanium SDK 1.x app working in the modern era on Titanium SDK 3.1.2.
One of the challenges I've managed to find myself stuck on is after upgrading from Google Android Maps API v1 to v2 I'm consistently getting this error:
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
I have installed in the ADK the 18.0.1 build tools as well as the required Google Play Services extras package. Uninstalling/reinstalling does nothing useful, and as far as I can tell there's no way to manually include the Play Store Services library in Titanium.
For reference I followed the instructions here to set up the Maps API v2 in the app. The following is what is in my tiapp.xml file (I replaced the actual package names):
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-permission android:name="com.example.permission.MAPS_RECEIVE"/>
<permission android:name="com.example.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<application>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="###"/>
<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="10"/>
</application>
Note that the correct certificates and correct API have been used within the Google API Console.
Does anyone have any idea why I might be unable to load the Google Play Services in my Titanium app?
Thanks in advance!
The maps only work on device. Are you running this in the emulator?
I have an additional permission set "android.permission.ACCESS_NETWORK_STATE"
Also double check to ensure your appId is correct and matches what is in your tiapp.xml file
<android xmlns:android="http://schemas.android.com/apk/res/android">
<tool-api-level>14</tool-api-level>
<manifest>
<!-- uses-sdk android:minSdkVersion="11" android:targetSdkVersion="14" -->
<!-- Camera Access -->
<uses-permission android:name="android.permission.CAMERA"/>
<uses-feature android:name="android.hardware.camera"/>
<uses-feature android:name="android.hardware.camera.autofocus"/>
<!-- Allows the API to download data from Google Map servers -->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<!-- Allows the API to cache data -->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<!-- Use GPS for device location -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<!-- Use Wi-Fi or mobile connection for device location -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<!-- Allows the API to access Google web-based services -->
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<!-- Specify OpenGL ES 2.0 as a requirement -->
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<!-- Replace <com.domain.appid> with your application ID -->
<uses-permission android:name="com.wiley.TIgram.permission.MAPS_RECEIVE"/>
<permission android:name="com.wiley.TIgram.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<application android:hardwareAccelerated="true" android:theme="#android:style/Theme.Holo.Light">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="XXXXXXXXXXXXXXXXXXXXXXXX"/>
<activity android:configChanges="keyboardHidden|orientation" android:name="ti.modules.titanium.media.TiCameraActivity" android:screenOrientation="landscape" android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen"/>
</application>
</manifest>
</android>
This is more of a suggestion than an answer but I got the same error and it made me bark up the wrong tree for quite some time before I realized I had an error somewhere else in the code. In my case, there was a view element that had a null attribute, though that wasn't clear from the stack trace. The Play Services error you pasted above was visible early on but it seems that the compiler will ignore it if the service is found.
:(
To make matters more confusing, I built the same code for iOS and there was no error.