Black screen in iOS when using another plugin

0 votes
asked Dec 28, 2018 by rmgb222 (150 points)

Hi EasyAR team,

I have encountered a black screen when building in Unity iOS. In XCode, log shows - "EasyAR is running with an unsupported graphics API of type -4""

The specifications are as follows:

- Unity 2018.2.6f1, XCode 10.1, EasyAR 2.3, iPhone 6S running iOS 12.1.

- Build Settings set to OpenGLES 2.0

Please also note that I have integrated another plugin (Google Firebase for Unity) but this seems to be not using "UnityRegisterRenderingPlugin" hence there is nothing to merge with EasyAR AppController.

Can you give other insights that I can try?

Can you also share why we need to merge app controllers when this issue arises?

Thanks

1 Answer

–1 vote
answered Dec 28, 2018 by zhnagjian (11,130 points)
Hello,

You can refer to the link https://www.easyar.cn/view/questionDetails.html#76
commented Dec 29, 2018 by rmgb222 (150 points)
Thank you for your answer, but like many questions asked regarding this issue, this is not very helpful.

I already made sure that I am following the platform specifications and even provided my specs.

It seems that EasyAR doesn't sit well with other plugins. Hope to see an improvement in 3.0
commented Jan 17, 2019 by zhnagjian (11,130 points)
Hello,

Usually this is not a bug in EasyAR or Unity, but a problem with the way the XCode project is combined.

In order to display correctly, you first need to ensure that the Graphics Device is set to GLES2 as described in the documentation.

Then you need to make sure that UnityRegisterRenderingPlugin(&ezarUnitySetGraphicsDevice, &ezarUnityRenderEvent); is called normally (just look at the code next to this code to see if it is called). If it is not called, it is definitely not normal. This code is in EasyARAppController.shouldAttachRenderDelegate if the file is not changed.

If you are not called, please find the reason yourself. There are many possibilities. The most common one is similar to the previous one (although the problem itself is not the same, the reason behind it is the same), that is, using IMPL_APP_CONTROLLER_SUBCLASS to register more, so Some (such as EasyAR) will not work. At this time, if there are multiple IMPL_APP_CONTROLLER_SUBCLASS or similar things, they need to be merged together. But other situations need to be based on the specific code to know where the problem is.

In addition, any Unity plugin that uses the native render plugin will have similar problems, so this should not be a new problem, but the plugin that uses the unity native render plugin is less likely to be encountered.
commented Jan 18, 2019 by rmgb222 (150 points)
Hi zhnagjian,

Thank you very much for your answer. I was able to find a workaround for my problem. You are correct that the EasyARAppController does not get called, which causes the bug.

In XCode root directory>Classes>main.mm,  I had to replace line 33 with:

UIApplicationMain(argc, argv, nil, [NSString stringWithUTF8String: "EasyARAppController"]);

This forces the correct app controller to run. But I feel this is a very dangerous workaround, but it works for me at least for the moment. Just make sure to merge other app controllers to EasyARAppController. Hope this helps others as well.

Thanks again for your help.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...