TROPHiT / UnityDeeplinks

A set of tools for Unity to allow handling deeplink activation from within Unity scripts
Apache License 2.0
104 stars 29 forks source link

Crash on iOS "UnityDeeplinks_init" when using Vuforia #5

Open FDCarneiro opened 7 years ago

FDCarneiro commented 7 years ago

Hello!

I came across this plugin when searching for something that helped me implement deeplinks in my android and iOS app. For android it works like a charm, however for iOS I'm not being able to solve an issue.

As far as I can tell it's due to an incompatibility between UnityDeeplinks and Vuforia. When "UnityDeeplinks_init" it's called the app crash, however if the call isn't made everything works just fine (except the deeplinks part of course).

Any idea or insight about this issue and how to solve it?

Thanks!

TROPHiT commented 7 years ago

I am not familiar with Vuforia. Can you provide some information about the crash? Maybe add some debug messages to see where the crash occurs?

FDCarneiro commented 7 years ago

Here is the log of the crash:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[VuforiaNativeRendererController setGameObjectName:]: unrecognized selector sent to instance 0x15591b00'
*** First throw call stack:
(0x21a1791b 0x211b2e17 0x21a1d2b5 0x21a1aee1 0x21946238 0x4df7db 0x113563 0x4bbba3 0xccc881 0x7397a3 0x733fb9 0x802dfb 0x802f7d 0x80201b 0x603e69 0x6dcd75 0x851f67 0xc3cef 0xc3ba9 0x30dc905 0x24073a0b 0x24073857 0x2375a50b 0x21c68759 0x219c637d 0x219da5b3 0x219d9cc7 0x219d80d9 0x21927229 0x21927015 0x22f17ac9 0x25ffb189 0xbbf97 0x215cf873)
libc++abi.dylib: terminating with uncaught exception of type NSException

This happens when the "UnityDeeplinks_init" function is called in the "Start" method of the "UnityDeeplinks" game object. If this call isn't made there is no crash and the other features of the app work just fine.

Other test I made was using your plugin without Vuforia to check if it could be related with the device, or iOS version. In this scenario your plugin works which leads me to think that it is in fact an incompatibility between the two plugin: UnityDeeplinks and Vuforia.

TROPHiT commented 7 years ago

The cause is related to the fact that Vuforia overrides the app delegate class: IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController)

UnityDeeplinks does the same, which means that they conflict.

Try to move all UnityDeeplinksAppController implementation block into Vuforia's, or change the UnityDeeplinks.mm file to be a category of Vuforia's app controller instead of being a subclass of the unity app controller.

ValentinChareyre commented 6 years ago

@TROPHiT : I have the same problem with an other plugin.

I would suggest you to take a look at this page to solve the issue:

http://eppz.eu/blog/override-app-delegate-unity-ios-osx-1/

bakalarczuk commented 4 years ago

@TROPHiT how to resolve conflict with Vuforia? When I move implementation of deep link to Vuforia, I have bunch of errors. I'm not familiar with Obj-C and haven't got such person. Please help...

yosun commented 4 years ago

Check out eppz github