sentry-unity
sentry-unity copied to clipboard
Android|iOS Native + Unity
I wondering if I can use both Unity and Android SDK together. I need to stream data from Unity App to unity dashboard and Android|iOS native app to their dashboards accordingly. I have native app which implements unity player as a view so that's the reason why I want this. If no, then I should probably use some tag to separate logs in groups?
Disabling the native support from within Unity and adding the Android SDK to your underlying app does not work for you? It is not a use case we currently support but I would expect it to work. Bare in mind that those two layers won't communicate.
Didn't try it yet, will check. But I believe it won't resolve manifest collision on android, where sentry dsn path is stored?
Nope, issue is still exists. On iOS I get this issue
Library not loaded: @rpath/Sentry.framework/Sentry Reason: tried: '/private/var/containers/Bundle/Application/27C7ADCD-873D-447B-9950-8958B5DBA689/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/27C7ADCD-873D-447B-9950-8958B5DBA689/Surprise-Stage.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (errno=2), '/usr/lib/swift/Sentry.framework/Sentry' (errno=2, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/27C7ADCD-873D-447B-9950-8958B5DBA689/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/27C7ADCD-873D-447B-9950-8958B5DBA689/Surprise-Stage.app/Frameworks/Sentry.
On Android I basically same issue about library duplication.
Did you disable native support from the Unity SDK?
Yes
Library not loaded: @rpath/Sentry.framework/Sentry Reason: tried: '/private/var/containers/Bundle/Application/27C7ADCD-873D-447B-9950-8958B5DBA689/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2)
The native SDKs get set up during the build process. That log mentions Framework/Sentry.framework which indicates to me that the SDK tried to set up the Cocoa SDK (and hence the conflict). Could you try running a clean build (i.e. completely delete the output directory)?
With the native support disabled there should be no modifications to the generated Gradle/Xcode projects.
Are you perhaps able to provide a minimal repro?
Oh, yes, I probably forgot to make clean build
@bitsandfoxes Hi, issue is still persist, I would say it looks same as in https://github.com/getsentry/sentry-unity/issues/969
dyld[9701]: Library not loaded: @rpath/Sentry.framework/Sentry Referenced from: <ED77ABE7-EE6A-38F9-915A-A083A757554E> /private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/UnityFramework.framework/UnityFramework Reason: tried: '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/preboot/Cryptexes/OS@rpath/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/System/Library/Frameworks/Sentry.framework/Sentry' (errno=2, not in dyld cache) Library not loaded: @rpath/Sentry.framework/Sentry Referenced from: <ED77ABE7-EE6A-38F9-915A-A083A757554E> /private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/UnityFramework.framework/UnityFramework Reason: tried: '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/UnityFramework.framework/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A3897-FE9A-405F-A7BA-DF27690D93D5/Surprise-Stage.app/Frameworks/Sentry.framework/Sentry' (errno=2), '/private/preboot/Cryptexes/OS@rpath/Sentry.framework/Sentry' (errno=2), '/private/var/containers/Bundle/Application/062A38 dyld config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/usr/lib/libBacktraceRecording.dylib:/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/System/Library/PrivateFrameworks/GPUToolsCapture.framework/GPUToolsCapture (lldb)
I just created empty project and it works without Native Support.
Must be problem happen when I'm converting UnityXcode project to an xcframework in order to use unity as library. Probably issue could be related to modulemap or smth https://github.com/Unity-Technologies/uaal-example/blob/master/docs/ios.md
Thanks for pointing this out. So there definitely is a conflict when enabling native support and embedding the Unity game as a library/framework inside of another project. I'm not really sure we can/want to resolve this. Our SDKs are not intended to be used in libraries and bringing it twice is kind of expected to create friction.
I disable native support and embed unity game as library inside of another project. And that another project has sentry installed via cocoa
The 1.2.0 release is going to address this. With native support disabled the SDK will no longer modify the exported project.