RenderHeads / UnityPlugin-AVProMovieCapture

AVPro Movie Capture is a Unity Plugin for advanced video capture to AVI/MP4/MOV files
https://renderheads.com/products/avpro-movie-capture/
49 stars 8 forks source link

[iOS] Crash when trying to run using the iOS simulator #428

Closed 435129214 closed 1 month ago

435129214 commented 2 months ago

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Describe the issue After exporting the iOS project in Unity, when using the framework, it crashes during running. May I ask how to reference the plugin dependencies after exporting the iOS project in this case? Your Setup (please complete the following information):

To Reproduce

  1. Import the plugin into Unity.
  2. Export an Xcode project from Unity.
  3. Run the exported iOS project directly.
  4. A crash occurs.

Logs

``` Thread Performance Checker: Thread running at User-interactive quality-of-service class waiting on a thread without a QoS class specified (base priority 45). Investigate ways to avoid priority inversions PID: 58089, TID: 548838 Backtrace ================================================================= 3 libiPhone-lib.dylib 0x0000000120a9e1e8 _ZN12UnityClassic31Baselib_SystemSemaphore_AcquireENS_30Baselib_SystemSemaphore_HandleE + 24 4 libiPhone-lib.dylib 0x000000011f6696aa _ZN9Semaphore13WaitForSignalEi + 138 5 libiPhone-lib.dylib 0x000000011fd01ae8 _ZN15GfxDeviceClient21WaitForPendingPresentEv + 124 6 libiPhone-lib.dylib 0x000000011fd019f6 _ZN15GfxDeviceClient10BeginFrameEv + 50 7 libiPhone-lib.dylib 0x000000011f85b71b _Z12PlayerRenderb + 270 8 UnityFramework 0x000000011893a492 -[UnityAppController(Rendering) repaint] + 106 9 UnityFramework 0x000000011892acff -[UnityAppController(ViewHandling) showGameUI] + 221 10 UnityFramework 0x00000001189338f4 -[UnityAppController startUnity:] + 128 11 Foundation 0x00007ff800e8adfb __NSFireDelayedPerform + 438 12 CoreFoundation 0x00007ff80042a749 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 20 13 CoreFoundation 0x00007ff80042a2d6 __CFRunLoopDoTimer + 801 14 CoreFoundation 0x00007ff800429a5a __CFRunLoopDoTimers + 243 15 CoreFoundation 0x00007ff8004242cc __CFRunLoopRun + 2108 16 CoreFoundation 0x00007ff8004236ad CFRunLoopRunSpecific + 557 17 GraphicsServices 0x00007ff8103da08f GSEventRunModal + 137 18 UIKitCore 0x00007ff805cc0ad1 -[UIApplication _run] + 972 19 UIKitCore 0x00007ff805cc5551 UIApplicationMain + 123 20 UnityFramework 0x0000000118939e88 -[UnityFramework runUIApplicationMainWithArgc:argv:] + 87 21 StarMeta 0x000000010bb54d09 main + 63 UnloadTime: 8.227907 ms [Mgr]Initialize game CoreAvatar.Mgr.d__19:MoveNext() System.Runtime.CompilerServices.AsyncTaskMethodBuilder:Start(TStateMachine&) CoreAvatar.Mgr.GameGlobal:InitAsync() CoreAvatar.Mgr.d__18:MoveNext() System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(TStateMachine&) CoreAvatar.Mgr.GameGlobal:StartInitAsync() CoreAvatar.Common.UILoading:Awake() dyld[58089]: missing symbol called (lldb) bt all * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT frame #0: 0x000000010d58888e dyld`__abort_with_payload + 10 frame #1: 0x000000010d5a2d95 dyld`abort_with_payload_wrapper_internal + 82 frame #2: 0x000000010d5a2dc7 dyld`abort_with_payload + 9 frame #3: 0x000000010bbaf0e5 dyld_sim`abort_with_payload + 26 frame #4: 0x000000010bb620d8 dyld_sim`dyld4::halt(char const*, dyld4::StructuredError const*) + 335 frame #5: 0x000000010bb85354 dyld_sim`dyld4::APIs::_dyld_missing_symbol_abort() + 18 * frame #6: 0x0000000118c76ad0 UnityFramework`il2cpp::vm::Runtime::InvokeWithThrow(method=0x000000010e390020, obj=0x0000000000000000, params=0x0000000000000000) at Runtime.cpp:576:13 [opt] frame #7: 0x0000000118c7695a UnityFramework`il2cpp::vm::Runtime::Invoke(method=0x000000010e390020, obj=0x0000000000000000, params=0x0000000000000000, exc=0x00007ff7b43a6eb0) at Runtime.cpp:562:20 [opt] frame #8: 0x0000000118c74ed7 UnityFramework`il2cpp::vm::Runtime::ClassInit(klass=0x0000000110207ca0) at Runtime.cpp:917:17 [opt] frame #9: 0x0000000119d9cb8a UnityFramework`::CaptureBase_Awake_m898AC2C641308AC16341F70E389ACC587751A8D4(CaptureBase_t2607C47ED8359FDEAC49AB637D4BD5F48F2CA26D *, const RuntimeMethod *) [inlined] il2cpp_codegen_runtime_class_init_inline(klass=) at il2cpp-codegen-il2cpp.h:657:9 [opt] frame #10: 0x0000000119d9cb7c UnityFramework`CaptureBase_Awake_m898AC2C641308AC16341F70E389ACC587751A8D4(__this=0x00000001275c1d20, method=) at RenderHeads.AVProMovieCapture.Runtime1.cpp:12842:4 [opt] frame #11: 0x0000000118c76ad0 UnityFramework`il2cpp::vm::Runtime::InvokeWithThrow(method=0x0000000110abde90, obj=0x00000001275c1d20, params=0x00007ff7b43a70d0) at Runtime.cpp:576:13 [opt] frame #12: 0x0000000118c7695a UnityFramework`il2cpp::vm::Runtime::Invoke(method=0x0000000110abde90, obj=0x00000001275c1d20, params=0x00007ff7b43a70d0, exc=0x00007ff7b43a71a0) at Runtime.cpp:562:20 [opt] frame #13: 0x000000011fc2f58b libiPhone-lib.dylib`scripting_method_invoke(ScriptingMethodPtr, ScriptingObjectPtr, ScriptingArguments&, ScriptingExceptionPtr*, bool) + 129 frame #14: 0x000000011fc41b9b libiPhone-lib.dylib`ScriptingInvocation::Invoke(ScriptingExceptionPtr*, bool) + 165 frame #15: 0x000000011fc452ec libiPhone-lib.dylib`ScriptingInvocation::InvokeChecked(ScriptingExceptionPtr*) + 56 frame #16: 0x000000011fc942bb libiPhone-lib.dylib`SerializableManagedRef::CallMethod(Object&, ScriptingMethodPtr) + 99 frame #17: 0x000000011fc57f42 libiPhone-lib.dylib`MonoBehaviour::CallAwake() + 134 frame #18: 0x000000011fc583d4 libiPhone-lib.dylib`MonoBehaviour::AddToManager() + 240 frame #19: 0x000000011fc57eaa libiPhone-lib.dylib`MonoBehaviour::AwakeFromLoad(AwakeFromLoadMode) + 694 frame #20: 0x000000011fc97194 libiPhone-lib.dylib`AwakeFromLoadQueue::InvokePersistentManagerAwake(AwakeFromLoadQueue::Item*, unsigned int, AwakeFromLoadMode, bool) + 344 frame #21: 0x000000011fc96fa4 libiPhone-lib.dylib`AwakeFromLoadQueue::PersistentManagerAwakeFromLoad(int, AwakeFromLoadMode, bool) + 124 frame #22: 0x000000011fc96f1c libiPhone-lib.dylib`AwakeFromLoadQueue::PersistentManagerAwakeFromLoad(ErrorsAndWarningsCapture*, bool) + 32 frame #23: 0x000000011f89246e libiPhone-lib.dylib`LoadSceneOperation::CompleteAwakeSequence() + 220 frame #24: 0x000000011f892718 libiPhone-lib.dylib`LoadSceneOperation::CompletePreloadManagerLoadScene() + 34 frame #25: 0x000000011f891ee0 libiPhone-lib.dylib`LoadSceneOperation::PlayerLoadSceneFromThread() + 646 frame #26: 0x000000011f892013 libiPhone-lib.dylib`LoadSceneOperation::CompleteLoadFirstScene() + 11 frame #27: 0x000000011f891a78 libiPhone-lib.dylib`LoadSceneOperation::IntegrateMainThread() + 214 frame #28: 0x000000011f8931f1 libiPhone-lib.dylib`PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int) + 237 frame #29: 0x000000011f893c2a libiPhone-lib.dylib`PreloadManager::UpdatePreloading() + 232 frame #30: 0x00000001208a651d libiPhone-lib.dylib`UnityPlayerLoopImpl(bool) + 289 frame #31: 0x000000011893a492 UnityFramework`-[UnityAppController(Rendering) repaint] [inlined] UnityRepaint at UnityAppController+Rendering.mm:236:9 [opt] frame #32: 0x000000011893a485 UnityFramework`-[UnityAppController(self=, _cmd=) repaint] at UnityAppController+Rendering.mm:90:9 [opt] frame #33: 0x000000011893a404 UnityFramework`-[UnityAppController(self=0x00006000026186c0, _cmd=) repaintDisplayLink] at UnityAppController+Rendering.mm:71:9 [opt] frame #34: 0x00007ff80afd124f QuartzCore`CA::Display::DisplayLinkItem::dispatch_(CA::SignPost::Interval<(CA::SignPost::CAEventCode)835322056>&) + 45 frame #35: 0x00007ff80afcd85c QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 996 frame #36: 0x00007ff80b0f8d6a QuartzCore`display_timer_callback(__CFMachPort*, void*, long, void*) + 439 frame #37: 0x00007ff8003f39c4 CoreFoundation`__CFMachPortPerform + 151 frame #38: 0x00007ff80042a774 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 41 frame #39: 0x00007ff800429d0a CoreFoundation`__CFRunLoopDoSource1 + 532 frame #40: 0x00007ff800424520 CoreFoundation`__CFRunLoopRun + 2704 frame #41: 0x00007ff8004236ad CoreFoundation`CFRunLoopRunSpecific + 557 frame #42: 0x00007ff8103da08f GraphicsServices`GSEventRunModal + 137 frame #43: 0x00007ff805cc0ad1 UIKitCore`-[UIApplication _run] + 972 frame #44: 0x00007ff805cc5551 UIKitCore`UIApplicationMain + 123 frame #45: 0x0000000118939e88 UnityFramework`-[UnityFramework runUIApplicationMainWithArgc:argv:](self=, _cmd=, argc=1, argv=0x00007ff7b43a9ca8) at main.mm:96:5 [opt] frame #46: 0x000000010bb54d09 StarMeta`main(argc=1, argv=0x00007ff7b43a9ca8) at main.mm:26:9 [opt] frame #47: 0x000000010bb5f3e0 dyld_sim`start_sim + 10 frame #48: 0x000000010d520386 dyld`start + 1942 ```

Screenshots 5591726820250_ pic

5601726820266_ pic

5611726820278_ pic

截屏2024-09-20 16 20 29 截屏2024-09-20 16 19 58 截屏2024-09-20 16 41 31

Videos If applicable, add a copy of your video or the URL

Please DO NOT LINK / ATTACH YOUR PROJECT FILES HERE

Instead email the link to us unitysupport@renderheads.com

Chris-RH commented 2 months ago

Have you tried the solutions in this thread: https://github.com/RenderHeads/UnityPlugin-AVProMovieCapture/issues/379

MorrisRH commented 2 months ago

We don't support the iOS simulator with AVPro Movie Capture at this time.

435129214 commented 2 months ago

this framework is dynamic or static?

435129214 commented 2 months ago

Undefined symbols for architecture arm64: "_AVPMC_PluginBootstrap", referenced from: _NativePlugin_MCPluginBootstrap_m6355BE967777E3A8FC8E6467632F07A7AFDCBB60 in RenderHeads.AVProMovieCapture.Runtime1.o _NativePlugin__cctor_mC2DA05C1E2883E7AFC025620C10DA119F1C7C81C in RenderHeads.AVProMovieCapture.Runtime1.o "_CallIosMethod", referenced from: _NativeBridge_CallIosMethod_mBB3AB78AE6D7FA372FADAD8AC240D41A2115D2A1 in Assembly-CSharp8.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Try it use #379,but has error like this.

MorrisRH commented 2 months ago

this framework is dynamic or static?

The framework is dynamic

Undefined symbols for architecture arm64: "_AVPMC_PluginBootstrap", referenced from: _NativePlugin_MCPluginBootstrap_m6355BE967777E3A8FC8E6467632F07A7AFDCBB60 in RenderHeads.AVProMovieCapture.Runtime1.o _NativePlugin__cctor_mC2DA05C1E2883E7AFC025620C10DA119F1C7C81C in RenderHeads.AVProMovieCapture.Runtime1.o "_CallIosMethod", referenced from: _NativeBridge_CallIosMethod_mBB3AB78AE6D7FA372FADAD8AC240D41A2115D2A1 in Assembly-CSharp8.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Try it use #379,but has error like this.

Are you trying to build with Unity as a library? That wasn't clear from your initial post. At this time we only support the iOS device SDK and iOS hardware. The plugin is not built against the simulator SDK and has no support for the x86_64 architecture.

435129214 commented 2 months ago

yes, we are trying to build with Unity as a library. The error above is happend in build as Device, not simular.

MorrisRH commented 2 months ago

The file AVProMovieCapture.m provides the AVPMC_PluginBootstrap function so it looks like the file is not being included as part of the Unity library in your project.

435129214 commented 2 months ago
截屏2024-09-23 18 15 58

Did you mean setting in Xcode or Unity project? we use AVProMovieCapture.framework deriectly.

MorrisRH commented 2 months ago

AVProMovieCapture.m is in the Unity project and should be included when exporting the Xcode project. It is separate to AVProMovieCapture.framework and required to load the framework at runtime. You can find it under Assets/Plugins/RenderHeads/AVProMovieCapture/Runtime/Plugins/iOS in the Unity project. In the exported Xcode project it will be under Libraries/Plugins/RenderHeads/AVProMovieCapture/Runtime/Plugins/iOS.

435129214 commented 2 months ago

WechatIMG369

MorrisRH commented 2 months ago

That function is provided in AVProMovieCapture.m and is required to link the framework at runtime.

435129214 commented 2 months ago

3721727089079_ pic How should these two options be set?

MorrisRH commented 2 months ago

That folder should contain both AVProMovieCapture.framework and AVProMovieCapture.m. You appear to be missing one of them (I cannot tell which from the screenshot). AVProMovieCapture.framework should have "Add to Embedded Binaries" checked. In a standard build this is handled in the script PostProcessBuild_iOS.cs which can be found in Assets/Plugins/RenderHeads/AVProMovieCapture/Editor/Scripts.