Closed Uralstech closed 7 months ago
Thanks for reporting. π We'll resolve it as soon as possible.
Thanks for reporting. π We'll resolve it as soon as possible.
Thank you!
Out of curiosity, did you try removing any references/instances of this script in your game scenes before building? I would think that Unity might be smart enough not to include it in the build if there are no references. In any case we will investigate.
Out of curiosity, did you try removing any references/instances of this script in your game scenes before building? I would think that Unity might be smart enough not to include it in the build if there are no references. In any case we will investigate.
Nope, I didn't think of it at the time!
I would think that Unity might be smart enough not to include it in the build if there are no references.
Seems not @HarrisonHough. I did these tests:
I checked the built APKs and, in both instances, they contain <uses-permission android:name="android.permission.CAMERA"/>
.
It seems Unity just checks all the code that exists and finds references to WebCamTexture
. There is one thing I haven't checked though - as described in the issue, I have the RPM sdk in my Assets/
folder. Maybe this could affect the tests I did?
In the latest release I added an optional define symbol that can be used to disable the use of WebCamTexture.
https://github.com/readyplayerme/rpm-unity-sdk-core/pull/259
Just add this define symbol in the player settings for your desired build platform and it should prevent the permission being added
RPM_DISABLE_CAMERA_PERMISSION
Let me know if it works for you and I will close this issue.
In the latest release I added an optional define symbol that can be used to disable the use of WebCamTexture. #259 Just add this define symbol in the player settings for your desired build platform and it should prevent the permission being added
RPM_DISABLE_CAMERA_PERMISSION
Let me know if it works for you and I will close this issue.
Thanks for this! Can confirm that it works.
Describe the bug The usage of
WebCamTexture
inRuntime\AvatarCreator\Scripts\UI\Elements\PhotoCaptureElement.cs
causes Unity to add the camera permission to our app'sAndroidManifest.xml
. As camera access is not allowed by Meta for their Quest platform, builds of our app cannot be uploaded to the Quest Store or App Lab.Expected behavior The camera permission should not be added in the
AndroidManifest.xml
unless the part of the SDK which requires camera access is being used in the app.Desktop (please complete the following information):
Edit: For those looking for a solution:
[Your project]\Library\PackageCache\com.readyplayerme.core
and save it in another location.Assets
folder.GLTFast
from the Package Manager (check this guide).com.readyplayerme.core\Runtime\AvatarCreator\Scripts\UI\Elements\PhotoCaptureElement.cs
like so:pragma warning disable CS1998
namespace ReadyPlayerMe.AvatarCreator { ///
/// A Unity MonoBehaviour class for capturing photos from the device's camera.
/// Allows starting and stopping the camera, capturing photos, and handling camera permissions.
///
public class PhotoCaptureElement : MonoBehaviour
{
[Header("Settings")]
[SerializeField] private RawImage cameraTextureTarget;
[SerializeField] private bool initializeOnEnable = true;
if UNITY_ANDROID
elif UNITY_IOS
endif
}