ajinasokan / flutter_displaymode

A Flutter plugin to set display mode in Android
MIT License
184 stars 22 forks source link

Unable to run pod install in iOS platform due to the SWIFT_VERSION . #4

Closed tkhenghong closed 4 years ago

tkhenghong commented 4 years ago

Hi, I'm using your plugin, version 0.1.0 to enable >60 fps for the Flutter app, but when I performed 'pod install' command in the ios directory, the pod command returned an error like below:

.....
[!] Unable to determine Swift version for the following pods:

- `flutter_displaymode` 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.

[!] Automatically assigning platform `iOS` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

I found out that adding:

  ...
  # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
  s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' }
  s.swift_versions = ['4.0', '4.2', '5.0']
  ...

in /ios/flutter_displaymode.podspec file will solve the issue. Thanks.

ajinasokan commented 4 years ago

Just to be clear this plugin is only for Android and on iOS it will throw a Missing Plugin Exception. AFAIK not giving swift version is not an issue, it will compile fine. The above message, I believe, is just a warning.

To solve this I will add:

s.swift_version = '5.0'

to the podspec. This seems to be the default one in the new Flutter templates.

tkhenghong commented 4 years ago

Hi @ajinasokan , thanks for your reply. Your solution also works as well. I will look forward to your patched release. Thanks.

ajinasokan commented 4 years ago

This is released to pub as version 0.1.1