Skip to content
koji ishii edited this page Mar 13, 2019 · 11 revisions

Trouble Shooting

ios

Your AppDelegate is the case of Objective-C

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.

  1. Bridging Header must be created.
    Open the project with XCode.
    Then choose File -> New -> File -> Swift File on Runner 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.

  1. Make sure you have use_frameworks! in the Runner block, in ios/Podfile.
target 'Runner' do
  use_frameworks!

Basically this is just OK, but if it doesn't work it's better to do the following

  1. Execute flutter clean
  2. Go to your ios folder, delete Podfile.lock and Pods folder and then execute pod install --repo-update

I made a working sample so please refer to it. https://github.com/ko2ic/sample_image_downloder_objc

'image_downloader/image_downloader-Swift.h' file not found, though AppDelegate is Swift

Probably commented out use_frameworks!.
Please don't do that.

If you have to comment out, most of the library lacks support. For Example, flutter_twitter_login.
In this case, it is better to use here because there is Pull Request .

If there is an application that is not supported, let's put out a Pull Requet.

The resource could not be loaded because the App Transport Security policy requires the use of a secure connection."

This happens when url is http.
It is the specification that is App Transport Security policy(ATS) of ios.

Please refer to here.

Android

compileSdkVersion is old

Most of the questions on Android are for older versions.

For example, I get the following error

error: resource android:attr/fontVariationSettings not found. 
error: resource android:attr/ttcIndex not found.

Please update your app's version on build.gradle.

Use a library that does not use AndroidX

Please use v.0.9.2.

Clone this wiki locally