videokit-ai / videokit

Low-code, cross-platform media SDK for Unity Engine. Register at https://videokit.ai
https://videokit.ai
Apache License 2.0
92 stars 14 forks source link

Crashes on startup when added to a project the also uses Firebase #81

Closed supermoos closed 3 months ago

supermoos commented 9 months ago

It was working ok before adding firebase to the project. So there's some incompatibility between this and firebase. I'm using firebase dynamic links only.

Here's the error that happens immediately on ios when running: Error loading /var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/UnityFramework.framework/UnityFramework (134): dlopen(/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/NatML.framework/NatML Referenced from: <90CAC92F-9B4D-3115-B84D-2CCEAEF63B8A> /private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/UnityFramework.framework/UnityFramework Reason: tried: '/usr/lib/swift/NatML.framework/NatML' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/NatML.framework/NatML' (no such file), '/private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/NatML.framework/NatML' (no such file), '/usr/lib/swift/NatML.framework/NatML' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/NatML.framework/NatML' (no such file), '/private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/NatML.framework/NatML' (no such file), '/private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/NatML.framework/NatML' (no such file) Error loading /var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/UnityFramework.framework/UnityFramework (134): dlopen(/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/UnityFramework.framework/UnityFramework, 0x0109): Library not loaded: @rpath/NatML.framework/NatML Referenced from: <90CAC92F-9B4D-3115-B84D-2CCEAEF63B8A> /private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/UnityFramework.framework/UnityFramework Reason: tried: '/usr/lib/swift/NatML.framework/NatML' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/NatML.framework/NatML' (no such file), '/private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/NatML.framework/NatML' (no such file), '/usr/lib/swift/NatML.framework/NatML' (no such file, not in dyld cache), '/private/preboot/Cryptexes/OS/usr/lib/swift/NatML.framework/NatML' (no such file), '/private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/NatML.framework/NatML' (no such file), '/private/var/containers/Bundle/Application/A280EF83-DCF6-4421-BB88-8356E20B0C94/MYAPP.app/Frameworks/NatML.framework/NatML' (no such file)

Firebase creates a cocoapods file - could this be an issue?

olokobayusuf commented 9 months ago

I think it could be because of Firebase. In Xcode, can you select the Unity-iPhone target and in the general tab, take a screenshot of the Frameworks, Libraries, and Embedded Content section? That list should include NatML.framework.

supermoos commented 9 months ago

Yes indeed, NatML.framework wasn't included in the main Unity-iPhone target. I added it manually using add framework files, could you provide an example on how to do this in a post build script perhaps so it can be automated? I already have something setup like this, but since it's a direct file reference needed to NatML.framework I'm unsure how to reference it.


    public static void OnPostprocessBuild (BuildTarget target, string pathToBuiltProject)
    {
        if (target == BuildTarget.iOS)
        {
            OnPostProcessBuildIOS(pathToBuiltProject);
        }
    }

    private static void OnPostProcessBuildIOS(string pathToBuiltProject)
    {
olokobayusuf commented 9 months ago

According to @Tillmania, this can be solved by downgrading to Unity 2022.3.13f1. Can you check?

olokobayusuf commented 9 months ago

This issue will be fixed once we deprecate and remove the NatML dependency from VideoKit. ETA for this is ~3 weeks.

tmlop commented 7 months ago

I was super excited to add this asset to my project but I still have the exact same issue. Makes the entire thing unusable unfortunately 😥 @olokobayusuf any updates on this?

olokobayusuf commented 7 months ago

@tmlop working very hard on getting this resolved ASAP! Should have something this coming week.

tmlop commented 7 months ago

@olokobayusuf Awesome, thank you so much!! Please let me know if you need more info from my end or if there is anything I can help with :) Just in case, I'm using the following sdks from Firebase: Authentication, Analytics, Realtime DB, Firestore and Cloud Messaging (ie. push notifications)

olokobayusuf commented 3 months ago

Fixed in VideoKit 0.0.18. Feel free to try out the latest VideoKit alpha build.