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

(iOS)(add-to-app): SWIFT_VERSION missing when compiling the iOS app #211

Closed
martin-headspace opened this issue Nov 27, 2024 · 3 comments
Closed
Labels
bug Something isn't working

Comments

@martin-headspace
Copy link
Contributor

Expected Behavior

On an add-to-app build, the app using this plugin should compile successfully and without a hitch.

Current Behavior

Developers get the following error:

- amplitude_flutter does not specify a Swift version and none of the targets (Runner) integrating it have the SWIFT_VERSION attribute set. Please contact the author or set the SWIFT_VERSION attribute in at least one of the targets that integrate this pod.

Developers can fix this by setting the SWIFT_VERSION environment variable to Swift 5.0 or above.

ENV['SWIFT_VERSION'] = '5'

Which, on most Flutter apps is a one time fix, but add-to-app developers have to either set this environment variable on their generated projects every time they compile OR they have to set it elsewhere that can be accessed.

Possible Solution

#210

Steps to Reproduce

  1. Create or reuse an existing add-to-app Flutter module.
  2. Try to compile for an iOS Device.
  3. Voila

Environment

  • SDK Version: Latest
  • Flutter Version: Latest Stable
  • Device: All iOS
  • Device OS and Version: Any iOS
@martin-headspace martin-headspace added the bug Something isn't working label Nov 27, 2024
@chungdaniel
Copy link
Contributor

Fixed with #210

@chungdaniel
Copy link
Contributor

chungdaniel commented Jan 2, 2025

Actually will leave open until build goes out :)

@chungdaniel chungdaniel reopened this Jan 2, 2025
@chungdaniel
Copy link
Contributor

@martin-headspace 3.16.6 including the fix has been released!

chungdaniel added a commit that referenced this issue Jan 14, 2025
Primary changes:
- Move iOS code `sharedDarwinSource` to reuse for macOS according to https://docs.flutter.dev/packages-and-plugins/developing-packages#shared-ios-and-macos-implementations - thanks to @jointhejourney for their work in #156 for the idea
- Added support for macOS in example app

Extra:
- Added swift_version to `amplitude_flutter.podspec`, follow-up to #211 for v4
- Bumped flutter depdendency to 3.7.0+ to support `sharedDarwinSource`

Note:
- PR should probably be focused mostly on non-example files

Addresses #46 
Jira: [[SDK - Flutter] Flutter macOS Support](https://amplitude.atlassian.net/browse/AMP-35292)
justin-fiedler pushed a commit that referenced this issue Jan 15, 2025
# [4.0.0-beta.7](v4.0.0-beta.6...v4.0.0-beta.7) (2025-01-15)

### Features

* add support for macOS ([#217](#217)) ([eb66de8](eb66de8)), closes [#156](#156) [#211](#211) [#46](#46)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants