Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with StreamVideoSwiftUI compilation #656

Closed
WcaleNieWolny opened this issue Feb 4, 2025 · 3 comments
Closed

Problem with StreamVideoSwiftUI compilation #656

WcaleNieWolny opened this issue Feb 4, 2025 · 3 comments

Comments

@WcaleNieWolny
Copy link

Hello, I am trying to install this library using Pod for a project targeting iOS 14+. Unfortunately, for whatever reason I get the following error

Image

How could I go about resolving this issue?

@ipavlidakis
Copy link
Collaborator

Hi,

Thanks for reaching out. I setup a new project (which i attached here) trying to replicate the issue but i wasn't able to. It would be great if:

  • you can provide us with further information about your project setup (what version of the SDK are you using, what xcode version and what os version is the simulator or device building on)
  • Give a try on the attached project and see if you can replicate the issue there. If not, modify it until you can get the same error and share it back with us.

Note: You will need to download, unzip and run pod install in the project's directory. test.zip

Best regards,
Ilias

@WcaleNieWolny
Copy link
Author

WcaleNieWolny commented Feb 5, 2025

Hello, thank you for taking the time to attempt to reproduce this problem. I got to thinking after I saw your message, and I came to the conclusion that it is CapacitorJS that is messing with the compilation. Capacitor is a framework similar to Cordova that allows for the creation of hybrid app (WebView + native)

In fact, I am trying to implement a Capacitor plugin that would allow smoother integration between native components (such as CallingKit) and the WebView.

In the default Capacitor 7 pod file, there are the following lines

post_install do |installer|
  assertDeploymentTarget(installer)
end

Here is the source code for assertDeploymentTarget

def assertDeploymentTarget(installer)
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # ensure IPHONEOS_DEPLOYMENT_TARGET is at least 14.0
      deployment_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f
      should_upgrade = deployment_target < 14.0 && deployment_target != 0.0
      if should_upgrade
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '14.0'
      end
    end
  end
end

The problem with the compilation happens because the Podfile attempts to set IPHONEOS_DEPLOYMENT_TARGET to 14.0 and this simply doesn't play well with this library. (Mostly because @available(iOS, introduced: 13, obsoleted: 14) doesn't actually prevent compilation on iOS 14+ or when iOS 13 is not available)

Thank you for your support, I will be closing this issue

@ipavlidakis
Copy link
Collaborator

Hi,

Thanks for letting us know about the root cause. I tried changing the deployment target and I was able to see the error message you posted initially. The behaviour is expected for sure (as you said @available doesn't exclude entities from compilation which is causing this error to popup).

If you manage to find a solution for this problem, it will be great if you share your findings (and workarounds) just for future reference.

In any case, thank you for using our product and don't hesitate to contact us for any other questions.

Best regards,
Ilias

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants