[IOS] No valid metal device

I have an application with contains a lot of plugin such as Google Map, Vuforia, ARfoundation and Zappar.
When I’m building the app on the iOS, Zappar camera shows black, and gives this error.

[28883:3446767] Do not have valid metal device for rendering.

I have tried to comment and uncomment the line in zappar-unity.h - “#define ZAPPAR_METAL_SUPPORT”. But this didn’t make any change.
Please help to understand the reason and solve the issue.
Thanks.

Hi @Tyom

You should only comment #define ZAPPAR_METAL_SUPPORT in case you do not want to use Metal API and use OPENGL instead! You can leave it as it is for general use case here.

Further, Metal is the default graphics API for iOS and Mac so please ensure it is selected in the Unity editor settings. A simple way to get proper editor related settings for UAR would be to use Zappar/Editor/Update Project Settings To Publish, which will set the default graphics API and required camera usage description for iOS platform.
[Note: this option updates the editor settings for active platform only, so if you’re switching between platforms you can run it once for each platform.]

HTH

I have only commented that line, but still getting same issue.
Picked that option from Unity - “Update Project Settings To Publish” and as I have camera description filled already, Zappar sdk will not change it.

Also Im trying on blank application with vuforia and Ar foundation inside, and everything works great. except how Zappar camera looks on IOS. it seem exposure is on hight level. my face is kinda burning.

Please do not comment this line!
#define ZAPPAR_METAL_SUPPORT

As i said, i tried both commented and not. Same result

Can you please give me some direct contact so i will be able to chat with you tech team quickly and find solution asap?

Hi @Tyom - please drop an email to our team on support@zappar.com and we’d be happy to help.

Hello @tom.defraine. I just did it, thanks for response. also here is the how Zappar camera look like on empty project compared with native camera view.


Working remotly. I figured out that the problem with black screen(no metal device found) comes when there is Vuforia in the project on IOS.
I used Vuforia 9.8.8. upgraded to 10+ seems it working. Will check locally tomorrow.
Anyway - please provide solution for version with Vuforia 9.8.8
to install it:
git+https://git-packages.developer.vuforia.com#9.8.8

@tom.defraine hey there, any idea how to fix issue with darker camera?

Hi @Tyom,

I have responded to your support ticket, but just in case this helps anybody:

There is an open GitHub issue for the camera appearing darker here. We’re currently looking into a fix for this, so please keep an eye out on this thread for updates. :rocket:

Have a great day!
Francesca :blush:

@Francesca what about metal device issue. It is very necessary to have it solved. please help

Hi everyone!

Just wanted to provide a quick update for those who may not be keeping track of the GitHub issue, as it includes a workaround.

There are a couple of temporary fixes for the dark camera which may be useful:

  1. Switch to Linear Color space mode by going to Project Settings > Player > Other Settings.

  2. Download the new ZapparCameraBackground.cs and CameraBackgroundShader.shader, then replace them in the respective directories of @uar/Runtime/ and @uar/Resources/Shader/. This will take care of gamma correction. Once this has been performed, find the ZapparCameraBackground script in your scene and set the Gamma Correction as per your requirement. We recommend a base value of 2.2.

@Tyom As for the metal device query - Vuforia Engine 9.8 is ‘no longer supported’, as is described here. Since this is third party software, it is out of our scope. I’d suggest you follow the update recommendations provided by Vuforia to experience their latest support.

Will check the solution for Darker camera.
About Vuforia - I’m agree with you. but my project is huge, to upgrade it i need to spend a lot of time,
But i need to solve it as quick as possible.
So there is no solution from your side.? :frowning:

Darker Camera Fixed, About the black screen with metal error, i have pulled request with fix. Enjoy

Hello everyone. I managed to fix the issue.
You just need to change UnityPluginLod and Unload function names in files zappa-unity.h and .mm
to the ZAPUnityPluginLoad and ZAPUnityPluginUnload.
Enjoy :wink: