iOS 14 crash after calling play() for each streaming source

andrew.n

Member
@Max Hello again, I downloaded your demo project and when I opened it, it looks like this:
Screenshot 2021-02-09 at 16.28.58.png

This is not looking like a clean installation of the framework in the demo project... looks like the project has already the references of both frameworks: FPWCSApi2 and FPWCSApi2Swift and also two references of WebRTC frameworks in the same folder which is strange...
I copied the frameworks inside the demo project and everything is ok, the project is not crashing at startup...

Screenshot 2021-02-09 at 16.49.19.png

Also at this step (5) from the docs, it looks like you copy both frameworks to the demo folder, BUT at step 6 I don't see the FPWCSApi2Swift.framework listed... why did this happen?



When I do the same steps for my app is not working...
1) I removed WebRTC from Cocoapods
2) I downloaded both frameworks and I included them in my project and I had to manually include in "Frameworks, Libraries and Embedded Content" the WebRTC.framework that was inside of FPWCSApi2.framework/Frameworks/WebRTC.framework. - If I don't do this manually integration I have build issues because of missing WebRTC.framework :) - Also, if I want to include the reference of WebRTC.framework from the FPWCSApi2Swift.framework, the initial reference is replaced...
3) I cleaned the DerivedData and the project itself but during the runtime, it is crashing
4) I tried to do a clean build install to a newly created simulator still not working
5) I tried to build the project on a real device and still not working...

On a clean simulator crash:
Code:
dyld: Library not loaded: @rpath/FPWCSApi2Swift.framework/FPWCSApi2Swift
  Referenced from: /Users/username/Library/Developer/CoreSimulator/Devices/5A56652A-1A60-465F-AB50-13EA0A1B0621/data/Containers/Bundle/Application/92560408-3CB4-4800-A315-F38761690538/AppName.app/AppName
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot
DYLD_LIBRARY_PATH=/Users/username/Library/Developer/Xcode/DerivedData/ProjectName-bxwkikkxazzdiqegsfonrunjorom/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/Applications/Xcode.app/Contents
(lldb)
On real device crash:
Code:
dyld: Library not loaded: @rpath/FPWCSApi2Swift.framework/FPWCSApi2Swift
  Referenced from: /private/var/containers/Bundle/Application/00E2AD30-A664-491F-A68E-91A9B94D75D3/AppName.app/AppName
  Reason: image not found
dyld: launch, loading dependent libraries
DYLD_LIBRARY_PATH=/usr/lib/system/introspection
DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib
(lldb)

Screenshot 2021-02-09 at 17.20.29.png



Screenshot 2021-02-09 at 17.20.39.png


Screenshot 2021-02-09 at 17.20.53.png
 

Max

Administrator
Staff member
Also at this step (5) from the docs, it looks like you copy both frameworks to the demo folder, BUT at step 6 I don't see the FPWCSApi2Swift.framework listed... why did this happen?
The screenshot is for iOS SDK 2.6 before Swift framework introduction, we'll fix it.
When I do the same steps for my app is not working...
We raised the ticket WCS-3065 to investigate this issue and let you know results here.
 

Max

Administrator
Staff member
We investigated the issue and modified the test project you've sent by the following way:
1. Removed GoogleWebRTC from Pods
2. Added WebRTC framework to the project
1612937053590.png

WebRTC framework should be added from FPWCSApi2Swift.framework
1612937231175.png

3. Set the following target build options
Code:
Enable Bitcode: No
Validate Workspace: Yes
1612937438595.png

After these steps, the application is build and running successfully without a crash.
You can download modified project here
 

andrew.n

Member
@Max Small note, also in "Frameworks, Libraries and Embedded Content", FPWCSApi2.framework and WebRTC.framework must be "Embed & Sign".
Also, as I see, GLKIt is no longer required... I changed the project build system from legacy to new build system and everything is working fine now.

Now, considering that the framework is working with the new build system do you consider making the framework available by Swift Package Manager?
 

Max

Administrator
Staff member
Now, considering that the framework is working with the new build system do you consider making the framework available by Swift Package Manager?
Yes, the framework is working with new build system now. There is the ticket WCS-2882 about publishing the framework in Swift package manager, we'll let you know in this topic when if will be ready.
 

andrew.n

Member
@Max I did the update as I told you before and we wanted to do some regression testing and during the project archiving we received the following errors:
logs.jpg


After I replaced the SDKs I made a build on my real device and I did some testing and everything was fine... I have issues only when I want to send a new build to TestFlight...
 

andrew.n

Member
@Max I downloaded 2.6.22 and I included both frameworks in the same folder... Some issues from yesterday were solved but some weren't ... Take a look in the screenshot above to see the remaining issues we get.
Group.jpg
 

Max

Administrator
Staff member
We fixed CFBundleVersion parameter for both Objective C and Swift frameworks in build 2.6.23.
Please also read here how to remove unsupported architectures.
 

andrew.n

Member
I included the run script that you mentioned and it looks like the issues were fixed... but other issues appeared o_O
 

Attachments

Max

Administrator
Staff member
I included the run script that you mentioned and it looks like the issues were fixed... but other issues appeared
This is know nested bundle issue. You should move WebRTC framework to the same level as iOS SDK framework. Please read here fo details.
 

andrew.n

Member
@Max Hello, I saw that there is a new version available (2.6.26) and after I downloaded I saw that the Swift version is changed a little bit... in the first place, it's FPWCSApi2Swift.xcframework (xcframework instead of the framework), and also inside I see that there are folders, for real device and simulator. Can you update the integration guide for this version? :)

Thanks
 

Max

Administrator
Staff member
Can you update the integration guide for this version? :)
No need to update, the integration is the same. The old framework was "fat" including both simulator and real devices architecture support. The XCFramework is "half-fat", it allows XCode to automatically choose the architecture while building for target device. So with XCFramework you don't need to remove unsupported architectures.
 
Top