Updating the Install Referrer Library from v1.0 to v1.1 added the following permissions:
WRITE_EXTERNAL_STORAGE
READ_EXTERNAL_STORAGE
READ_PHONE_STATE
Those permissions are not present in the Install Referrer Library manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.installreferrer" >
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<application />
</manifest>
Source:
https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer/1.1
Why those permissions added to the merged manifest?
This is because they have added a dependency to
com.google.android.gms:play-services-measurement:17.2.1
Which adds those permissions.
You can find it on the file:
manifest-merger-blame-debug-report.txt
which is under "yourApp/build/intermediates/manifest_merge_blame_file/debug
It's probably a bug. I currently just downgraded back to 1.0.
But if you need this version you can add
<uses-permission android:name="<permission_name>" tools:node="remove" />
To disable it.
Know that if you'll use any API which needs it inside the library it could lead to a crash so i won't recommend doing so.
Version 1.1 and 1.1.1 are missing "minSdkVersion". This would automatically add those permissions. See similar issue here: Google Play Services 12.0.1.
Solution
Version 1.1.2 solves this issue.
Details
Manifest.xml for v1.0 (from https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer/1.0)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.installreferrer" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="22" />
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<application />
</manifest>
Manifest.xml for v1.1 (from https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer/1.1)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.installreferrer">
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<application />
</manifest>
Related
Im confused. My Manifest looks like this (App-Name removed):
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="2" android:versionName="0.8.2" package="com.xxxxxxx.xxxx" android:installLocation="auto">
<uses-sdk android:minSdkVersion="26" android:targetSdkVersion="30" />
<application android:label="LABEL" android:theme="#style/MainTheme" android:usesCleartextTraffic="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
But if I open the "permission" page in App-Store, it shows that the App "may use" storage permission.
My App doesnt need any access to external storage. Why this permission is listet in the store (and also in the app-settings after installation)?
How can I remove this? Its confusing for the users.
We are trying to update Google Play Install Referrer Library and
Internally it's adding some external read write permissions.
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
Do we really need to stick with the permissions ?
dependency implementation 'com.android.installreferrer:installreferrer:1.1
Source https://developer.android.com/google/play/installreferrer/library.html
Install referrer adds this permission due to the fact that the targetSdkVersion is a value lower than the version in which the restriction was added.
If you take a look at generated manifest-merger-report in the build folder of your app, you can see this information:
uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from android/app/src/main/AndroidManifest.xml:1:1-130:12 reason: com.android.installreferrer has a targetSdkVersion < 4
Information on how this implicit system permission works on Android can be found in this documentation :
https://developer.android.com/studio/build/manifest-merge#inspect_the_merged_manifest_and_find_conflicts
Quoting from this answer (and completing):
Version 1.1 and 1.1.1 are missing "minSdkVersion". This would automatically add those permissions (because the default SDK < 4 as said by #thiagolr). See similar issue here: Google Play Services 12.0.1.
Solution
Version 1.1.2 solves this issue.
Details
Manifest.xml for v1.0 (from https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer/1.0)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.installreferrer" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="22" />
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<application />
</manifest>
Manifest.xml for v1.1 (from https://mvnrepository.com/artifact/com.android.installreferrer/installreferrer/1.1)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.installreferrer">
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />
<application />
</manifest>
I've also come across this issue.
But in my case, the 1.1 version is also adding the READ_PHONE_STATE permission
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
I've decompiled the .aar file for installreferrer:1.1 and checked the manifest and pom file, there is nothing in those files to indicate that these permissions should be added.
The library manifest file only adds this permission (which is always has in previous versions):
<uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE"/>
I haven't been able to find any official information regarding this.
But other Google libraries have had issues in the past with adding additional, unneeded, permissions, which have then been removed in a hotfix version shortly after.
For example, this:
Why has the READ_PHONE_STATE permission been added?
So i hope the same is gonna happen here.
Edit: Solution: Version 1.1.2 (and above) solves this issue.
From this answer:
This is because they have added a dependency to
com.google.android.gms:play-services-measurement:17.2.1
Which adds those permissions.
You can find it on the file: manifest-merger-blame-debug-report.txt which is under "yourApp/build/intermediates/manifest_merge_blame_file/debug"
It's a bug. Also, installreferrer 1.1.1 doesn't solve it.
Solution:
Update to installreferrer 1.1.2 or any version above (current version is 2.1`)
Obsolete:
Easiest solution is to downgrade installreferrer back to 1.0 for now.
But if you need this version, you can add:
<uses-permission android:name="<permission_name>" tools:node="remove" />
To disable it.
But know that if you'll use any API which needs it inside the library, it could lead to a crash, so I won't recommend doing so.
These permissions are added because com.android.installreferrer has a targetSdkVersion < 4. You can see it on the manifest-merger-release-report.txt file located on Temp\gradleOut\build\outputs\logs folder inside your project. This is a bug and it will probably be fixed on a newer version.
In order to fix this, you need to find out which plugin is adding com.android.installreferrer as dependency.
In my project, the culprit was the Facebook plugin. It uses the com.facebook.android:facebook-core:5.15.x package which is responsible for adding the com.android.installreferrer:installreferrer:1.1 dependency.
The solution was to rollback to com.facebook.android:facebook-core:5.13.0, which doesn't have a com.android.installreferrer dependency.
Edit the file FacebookSDK/Plugins/Editor/Dependencies.xml and change these packages to:
<androidPackage spec="com.facebook.android:facebook-core:[5,5.13.0)" />
<androidPackage spec="com.facebook.android:facebook-applinks:[5,5.13.0)" />
<androidPackage spec="com.facebook.android:facebook-login:[5,5.13.0)" />
<androidPackage spec="com.facebook.android:facebook-share:[5,5.13.0)" />
Next, don't forget to resolve the dependencies again: Assets > Play Services Resolver > Android Resolver > Force Resolve
1.1.2 is released, it adds minSdkVersion correctly.
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="22" />
One could theoretically remove them altogether with the manifest-merger:
<manifest
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
</manifest>
But if the library will then still work as expected is another story -
it's rather an exception, that a Google library requires unnecessary permissions.
The release notes and the documentation do not mention permissions.
I am trying to upload an APK file to Huawei App gallery and after submitting it to review i got this result with two warnings
https://i.imgur.com/8E2cewu.jpg
FIRST Warning :
Incorrect adaptive devices. Check whether the configuration in the AndroidManifest.xml file is compatible with watch apps.
SECOND Warning :
Incorrect adaptive devices. Check whether the configuration in the AndroidManifest.xml file is compatible with VR apps.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="####">
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:name=".Application"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/GreenActionBarTheme">
</application>
</manifest>
Looks it was not a big problem because they accepted my app 3 days later .. So you just need to be patient !
I'm unable to get google maps api v2 to display anything more than a blank screen in my Android Xamarin application.
In logcat, I get the following error.
07-08 16:08:12.192: E/Google Maps Android API(28625): Failed to load map. Error contacting Google servers. This is probably an authentication issue (but could be due to network errors).
This makes me believe it is a problem with my API key. I don't know what I'm missing though. Here is my AndroidManifest.xml.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:installLocation="auto" android:versionCode="2" android:versionName="2.0.0.0" package="com.deg.blubcnmobl.droid">
<uses-sdk android:targetSdkVersion="12" />
<uses-feature android:glEsVersion="0x00020000" android:required="true" />
<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-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<permission android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE" android:protectionLevel="signature" />
<uses-permission android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE" />
<application android:icon="#drawable/logo" android:debuggable="true" android:enabled="true" android:persistent="false" android:allowClearUserData="true" android:theme="#android:style/Theme.Black.NoTitleBar">
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="MY_KEY" />
</application>
</manifest>
Here is my activity axml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<fragment
class="com.google.android.gms.maps.SupportMapFragment"
android:id="#+id/mapfragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
I have Google Maps Api V2 Android turned on in API settings.
Here is the page where I created the API key.
Make sure you add these permissions to the manifest
<permission
android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.deg.blubcnmobl.droid.permission.MAPS_RECEIVE"/>
You seem to be missing a number of permissions in your manifest.
Sample manifest for Maps V2 capable of running on API level 8 and upwards
https://github.com/ddewaele/GoogleMapsV2WithActionBarSherlock/blob/master/GoogleMapsV2SkeletonV8/AndroidManifest.xml
Sample layout for Maps V2 capable of running on API level 8 and upwards
https://github.com/ddewaele/GoogleMapsV2WithActionBarSherlock/blob/master/GoogleMapsV2SkeletonV8/res/layout/activity_main.xml
Sample activity for Maps V2 capable of running on API level 8 and upwards
https://github.com/ddewaele/GoogleMapsV2WithActionBarSherlock/blob/master/GoogleMapsV2SkeletonV8/src/com/example/googlemaps/v2/skeleton/api8/MainActivity.java
You can clone the git repository above and try the complete GoogleMapsV2SkeletonV8 application.
Please check this post: Google Map Android Api V2 Sample Code not working, if you are completely sure you did the right steps and still see the blank screen then follow the second answer, the authentication gets cached somewhere, try to uninstall the application manually (just like you do with a normal application) then "Run" again the project.
I have given an answer of it at https://forums.xamarin.com/discussion/26058/google-map-is-showing-a-blank-screen-in-android
I am trying to add google maps to my android application, and I followed this documentation: https://developers.google.com/maps/documentation/android/start
First off, is my Manifest file correct?
Manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="where.is.the.action"
android:versionCode="1"
android:versionName="1.0">
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="where.is.the.action.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="where.is.the.action.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"/>
<application android:label="#string/app_name" android:icon="#drawable/ic_launcher">
<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>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxxx"/>
</application>
</manifest>
Then here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<Button
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="My Location"
android:onClick="getLocation"
android:layout_weight="0"
/>
<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"/>
</LinearLayout>
It works fine if I remove the fragment tag, but once I add it back in the app closes and displays: "Unfortunately, MainActivity has stopped."
Does anyone see what is wrong?
Perhaps you are trying to use MapFragment on a device that is not running Android 3.0+. MapFragment is for use with an Activity and the native fragment implementation from API Level 11. SupportMapFragment is for use with a FragmentActivity and the fragment backport supplied by the Android Support Library.
UPDATE
Upon further review, the problem is probably two-fold:
You attempted to attach google-play-services.jar to your project, instead of following the instructions and attaching the Play Services Android library project to your project.
You did #1 above by messing with your build path directly, instead of copying the JAR to libs/.
Undo what you did originally. Then, follow the instructions to attach the Android library project to your project (which, as a side effect, will properly set up that JAR for you).
Since it appears that you are doing a command-line build, you will need to create the command-line build files for the Android library project, which Google elected not to ship (grrrrrrrrrrrrrrr). Run:
android update project -p /home/ryan/android-sdk-linux/extras/google/google_play_services/libproject/google-play-services_lib
to create the necessary files.