Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v9.2.0 adds unnecessary permissions in manifest #3510

Closed
ChaserKnight opened this issue Aug 9, 2024 · 8 comments
Closed

v9.2.0 adds unnecessary permissions in manifest #3510

ChaserKnight opened this issue Aug 9, 2024 · 8 comments

Comments

@ChaserKnight
Copy link

[REQUIRED] Step 1: Describe your environment

  • Unity version: 2022.3.40f1
  • Google Mobile Ads Unity plugin version: 9.2.0
  • Plugin installation method: .unitypackage import
  • Platform: Android
  • Platform OS version: all
  • Any specific devices issue occurs on: all
  • Mediation ad networks used, and their versions: none

[REQUIRED] Step 2: Describe the problem

Steps to reproduce:

AdMob plugin latest version 9.2.0 adds unnecessary permissions (mentioned below), these were never added in the past. Users complain if new permissions are added. Why are these added now? Are these required by the plugin?

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

I looked in the "manifest-merger-release-report.txt" file and this is the reason mentioned there, please take a look, please fix this issue. I don't want these weird permissions added.

uses-permission#android.permission.WRITE_EXTERNAL_STORAGE
IMPLIED from /Users/xx/xx/Project/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml:2:1-5:12 reason: com.google.unity.ads has a targetSdkVersion < 4
uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from /Users/xx/xx/Project/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml:2:1-5:12 reason: com.google.unity.ads has a targetSdkVersion < 4
uses-permission#android.permission.READ_EXTERNAL_STORAGE
IMPLIED from /Users/xx/xx/Project/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/src/main/AndroidManifest.xml:2:1-5:12 reason: com.google.unity.ads requested WRITE_EXTERNAL_STORAGE
@wangping0214
Copy link

Same issue.

@NVentimiglia
Copy link
Member

I was unable to replicate this issue. The Hello world app had the following permissions.

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.google.android.gms.permission.AD_ID"/>
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_AD_ID"/>
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_ATTRIBUTION"/>
<uses-permission android:name="android.permission.ACCESS_ADSERVICES_TOPICS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>

Could this be a separate dependency?

@ChaserKnight
Copy link
Author

I also mentioned in the original post about the "manifest-merger-release-report.txt" file, which states the reason behind this. As you can see in the report, "reason: com.google.unity.ads has a targetSdkVersion < 4". It means it is coming from "com.google.unity.ads". I don't have any other plugin beside admob in my app. If it is not happening because of admob, then why does the report states the reason coming from com.google.unity.ads?

@NVentimiglia
Copy link
Member

Thanks, I will take a deeper look into this issue and I will get back to you shortly.

@chicotx56
Copy link

I use Unity 2021.3.39f1 and this problem does not occur. After updating to Unity 2021.3.43f1 this problem occurs in this version of the plugin and also in previous ones, such as GoogleMobileAds-v9.1.0 and GoogleMobileAds-v9.0.0. I had to go back to the old version of Unity. Apparently there is some problem between the plugin and recent versions of Unity.

@AndrewShields
Copy link

AndrewShields commented Sep 22, 2024

im also seeing this. didn't start happening until i added "Google Mobile Ads for Unity" for the first time

Unity 2022.3.46f1
Google Mobile Ads for Unity 9.2.0

@IShix-g
Copy link

IShix-g commented Sep 22, 2024

@AndrewShields Thanks for letting me know about the duplication.

Environment

  • Unity version: 2021.3.43f1
  • Google Mobile Ads Unity plugin version: v9.2.0
  • Plugin installation method: .unitypackage import
  • Minimum API Level: 22
  • Target API Level: 34

READ_PHONE_STATE / READ_EXTERNAL_STORAGE

It may contain libraries for which you have not specified a version.

Note: If both your minSdkVersion and targetSdkVersion values are set to 3 or lower, the system implicitly grants your app this permission. If you don't need this permission, be sure your targetSdkVersion is 4 or higher.

Solving temporary problems

I added the following to AndroidManifest.xml as it is a permission that is definitely not needed for my game.

<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove" />

@NVentimiglia
Copy link
Member

The issue related to the extra permissions has been identified and will be fixed in the next release. Thanks for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants