NotSupportedException: Specified method is not supported on Xcode when using Coroutines
void Awake()
{
StartCamera();
}
public void StartCamera()
{
Debug.Log("Start Open");
// Create a basic scanner
StartCoroutine(SetPermision());
}
IEnumerator SetPermision()
{
Debug.Log("Request Camera Open");
Debug.Log("Camera Open");
yield return Application.RequestUserAuthorization(UserAuthorization.WebCam);
if (Application.HasUserAuthorization(UserAuthorization.WebCam))
{
BarcodeScanner = new Scanner();
BarcodeScanner.Camera.Play();
// Display the camera texture through a RawImage
BarcodeScanner.OnReady += (sender, arg) => {
// Set Orientation & Texture
Image.transform.localEulerAngles = BarcodeScanner.Camera.GetEulerAngles();
Image.transform.localScale = BarcodeScanner.Camera.GetScale();
Image.texture = BarcodeScanner.Camera.Texture;
// Keep Image Aspect Ratio
var rect = Image.GetComponent<RectTransform>();
var newHeight = rect.sizeDelta.x * BarcodeScanner.Camera.Height / BarcodeScanner.Camera.Width;
rect.sizeDelta = new Vector2(rect.sizeDelta.x, newHeight);
RestartTime = Time.realtimeSinceStartup;
};
}
}
Getting this error while running above lines on iOS, Works great on android and editor.
PLease help
I m on 2019.3, xcode version 11.5
Start Open ContinuousDemo:StartCamera() ContinuousDemo:Awake() (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 35)
Uploading Crash Report NotSupportedException: Specified method is not supported. at ContinuousDemo+d__45.MoveNext () [0x00000] in :0 at UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) [0x00000] in :0 at ContinuousDemo.Awake () [0x00000] in :0 ContinuousDemo:Awake()
Comment