Mobile-UXSDK-iOS
Mobile-UXSDK-iOS copied to clipboard
SDK 4.7 crashes on launch when FFmpeg library can't be loaded
I updated to the newest SDKs (4.7) via CocoaPods and now the app crashes on launch with this error (Xcode 9.4.1):
dyld: Library not loaded: @rpath/FFmpeg.framework/FFmpeg
Referenced from: /private/var/containers/Bundle/Application/D650DC16-B7C8-440B-9011-029B7E421C71/SharperShape.app/Frameworks/DJIUXSDK.framework/DJIUXSDK
Reason: image not found
(lldb)
Tried to clean the project and build folder, and to delete and reinstall all pods. Still same problem.
It looks like you missed bringing in the DJIWidget file - try integrating that, which should take care of your crash. If you need examples of how to do the integration see our Sample Code. Also, you must then remove the ios-videopreviewer project if you were using it previously.
@dji-lisafedane thanks, this ultimately solved the problem! (Yes, our app was using the old VideoPreviewer project.) Might be helpful for other developers to add a note on the exact integration steps somewhere in the SDK installation guide, too – it's a bit tricky to look just at the sample project to see which parts to embed and where.
Ah, now I noticed it was already added there: https://github.com/dji-sdk/Mobile-UXSDK-iOS/commit/b348db87388f56a3991c86d0dab9753ac0f1add2 :)
Though still a bit more elaborated instructions might be useful – I first tried to just add the whole DJIWidget folder and that didn't work, I had to add the DJIWidget project and the FFmpeg framework separately, and then add them both to Embedded binaries under my build target.
Another user posted on Stack that could be useful: https://stackoverflow.com/questions/51992339/error-on-app-compilation-using-new-dji-uxsdk-ios-4-7-ffmpeg-library-not-found/51993999#51993999
for those coming to this issue now, DJIWidget
is its own pod now. steps:
- remove VideoPreviewer from your frameworks folder
- add
pod 'DJIWidget'
to your podfile -
pod install
- replace
VideoPreviewer
imports withDJIWidget
- replace
VideoPreviewer
class references withDJIVideoPreviewer
how do we solve this issue when im not using VideoPreviewer? sorry i am new to xcode and ios development.
i followed the instructions here: https://developer.dji.com/mobile-sdk/documentation/ios-tutorials/UXSDKDemo.html
and im getting this error when i compile and test on simulator ios 12 dyld: Library not loaded: @rpath/DJIWidget.framework/DJIWidget Referenced from: /Users/user147152/Library/Developer/CoreSimulator/Devices/8341CFF8-3236-40CB-8339-21D791BD3F39/data/Containers/Bundle/Application/6287AD61-2F34-42A2-9A94-D492A41CFB8C/ImportSDKDemo.app/Frameworks/DJIUXSDK.framework/DJIUXSDK Reason: image not found (lldb)
I have the exact same issue as @rlynjb :
I changed the Podfile as instructed (https://developer.dji.com/mobile-sdk/documentation/ios-tutorials/UXSDKDemo.html). Project builds fine, but running on the device it crashes and outputs the error:
dyld: Library not loaded: @rpath/DJIWidget.framework/DJIWidget Referenced from: /private/var/containers/Bundle/Application/4AD487FA-EE69-4378-984F-1DB69B6BD969/FIS-iOS.app/Frameworks/DJIUXSDK.framework/DJIUXSDK Reason: image not found
The Podfile config is following:
pod 'DJI-SDK-iOS', '~> 4.8'
pod 'DJI-UXSDK-iOS', '~> 4.8'
pod 'DJIWidget', '~> 1.2'
Adding use_frameworks!
fixed the issue. I also had to add use_modular_headers!
so that other Pods also worked.
My Podfile:
use_modular_headers!
target 'ProjectName' do
use_frameworks!
pod 'DJI-SDK-iOS', '~> 4.8'
pod 'DJI-UXSDK-iOS', '~> 4.8'
pod 'DJIWidget', '~> 1.2'
...
end