-
Notifications
You must be signed in to change notification settings - Fork 120
Home
koji ishii edited this page Mar 12, 2019
·
11 revisions
If you did not select swift in Platform channel language, you will see one of the following errors.
=== BUILD TARGET image_downloader OF PROJECT Pods WITH CONFIGURATION Debug ===
The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. Supported values are: 3.0, 4.0, 4.2. This setting can be set in the build settings editor.
=== BUILD TARGET image_downloader OF PROJECT Pods WITH CONFIGURATION Debug ===
~/.pub-cache/hosted/pub.dartlang.org/image_downloader-0.11.2/ios/Classes/ImageDownloaderPlugin.m:2:9: fatal error: 'image_downloader/image_downloader-Swift.h' file not found
#import <image_downloader/image_downloader-Swift.h>
[!] Unable to determine Swift version for the following pods:
- `image_downloader` 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.
This problem is on the flutter side, so all plugins created with swift have the same problem. https://github.com/flutter/flutter/issues/25676#issuecomment-449543241
You need to make some settings to solve this.
- Bridging Header must be created.
Open the project with XCode.
Then chooseFile -> New -> File -> Swift File
onRunner
holder.
Create the swift file(), then also create Bridging Header, click it on a dialog.
This will set SWIFT_VERSION
, SWIFT_OBJC_BRIDGING_HEADER
and so on in XCode -> Build Settings
.
- Make sure you have
use_frameworks!
in the Runner block, inios/Podfile
.
target 'Runner' do
use_frameworks!
Basically this is just OK, but if it doesn't work it's better to do the following
- Execute
flutter clean
- Go to your ios folder, delete
Podfile.lock
andPods
folder and then executepod install --repo-update
I made a working sample so please refer to it. https://github.com/ko2ic/sample_image_downloder_objc