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

Firebase analytics add READ_PHONE_STATE when build android with gradle build system #68

Closed
takaaptech opened this Issue Mar 9, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@takaaptech
Copy link

takaaptech commented Mar 9, 2017

Hi,
I just import firebase unity analytics and build with build system is gradle. In apk out, there are some permission that i think do not need for analytics:

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

After read manifest-merger-release-report.txt i found this line:

android:uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from /Users/imac/unity/study/build_test/Temp/gradleOut/src/main/AndroidManifest.xml:2:1-43:12 reason: com.google.firebase.unity.analytics has a targetSdkVersion < 4

So how can i config unity and analytics so to not include READ_PHONE_STATE permission?

Thank so much!

@stewartmiles

This comment has been minimized.

Copy link
Contributor

stewartmiles commented Mar 15, 2017

Looks like a couple of our AARs don't specify a minSdkVersion in the AndroidManifest.xml which is resulting in Gradle builds falling back to assuming the targetSdkVersion for the AAR < 4 (which seems a little conservative to me). It's a similar issue to what happened in Google Play Services https://developers.google.com/android/guides/releases#november_2016_-_v100 . The only workaround right now is to unpack each .srcaar file in the project and add the line "" to each AndroidManifest.xml. Alternatively you could safely remove the READ_PHONE_STATE permission from the generated AndroidManifest.xml and repack the APK if you have the skills.

We have a fix lined up internally and will post when it's published.

@stewartmiles

This comment has been minimized.

Copy link
Contributor

stewartmiles commented Mar 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.