Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Why does AR Foundation 6 require READ_PHONE_STATE?

Discussion in 'AR' started by Masashi-Wada, Apr 15, 2024.

  1. Masashi-Wada

    Masashi-Wada

    Joined:
    Jul 6, 2010
    Posts:
    90
    Hi,
    When using AR Foundation 6.0.1 and Unity 6000.b15, I found that it requires android's READ_PHONE_STATE permission. Please tell me the reason and information for this. Due to Google Play Store data safety requirements, I would need to know this detail in order to publish it to users.

    I have attached the manifest analysis by apkanalyzer. I know this permission was not needed when using Unity 2022.3 and ARFoundation 5.1.
     

    Attached Files:

  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,135
    This is unfortunately due to a regression in the Unity 6 Editor. The team responsible has been notified, and they've identified a fix. I've requested a public IssueTracker link so that you can track the progress of this issue.
     
  3. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    86
    Hey @Masashi-Wada, the issue was caused by the updated Google build-tools we added into Unity-6. The fix should be landing soon.

    Stay updated on the progress of this issue by following the link → issuetracker/UUM-69911
     
  4. Masashi-Wada

    Masashi-Wada

    Joined:
    Jul 6, 2010
    Posts:
    90
    Thank you for your support. That's a very welcome fix.
     
  5. yusufalibrahim1994

    yusufalibrahim1994

    Joined:
    Nov 13, 2019
    Posts:
    2
    Thanks will keep an eye on the issue tracker! I have the same issue where I can't build for Meta Quest using Unity 6 because of this problem with android.permission.READ_PHONE_STATE issue
     
  6. Masashi-Wada

    Masashi-Wada

    Joined:
    Jul 6, 2010
    Posts:
    90
    I no longer see it on 6000.0.1f1. Thank you!
     
  7. Hypnotoad0

    Hypnotoad0

    Joined:
    Jun 22, 2013
    Posts:
    48
    Still happens to me with Unity 6000.0.1f1
     
  8. manugil

    manugil

    Unity Technologies

    Joined:
    Jan 13, 2020
    Posts:
    86
    Try doing a clean build and see if that helps regenerate the .gradle files.

    The issue was caused by not adding
    minSdk
    attribute on .gradle files from libraries, such as the ones used by ARFoundation. If
    minSdk
    is not present, Google adds some permissions such as
    READ_PHONE_STATE
    , that's why you must always set it explicitly.
     
    andyb-unity likes this.