Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

IOS #3

Open
vishva92 opened this issue Mar 18, 2019 · 7 comments
Open

IOS #3

vishva92 opened this issue Mar 18, 2019 · 7 comments

Comments

@vishva92
Copy link

i'm new to flutter , i cant built my app for IOS because get_ip plugin giving #import <get_ip/get_ip-Swift.h> file not found error

@lotrofans
Copy link
Owner

Hi! I am sorry, but I can not reproduce the error. Try flutter doctor and check whether any error occurs or run flutter upgrade.

@vishva92
Copy link
Author

vishva92 commented Mar 19, 2019

I upgraded the flutter and here is my flutter doctor result. i'm still getting above error. i want test this app on IOS device.
[✓] Flutter (Channel master, v1.3.14-pre.6, on Mac OS X 10.13.6 17G65, locale en-US)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.io/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that
location.
You may also want to add it to your PATH environment variable.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[!] Android Studio (not installed)
[✓] Connected device (1 available)

here is the error

=== BUILD TARGET get_ip OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/ascensionit/.pub-cache/hosted/pub.dartlang.org/get_ip-0.2.0/ios/Classes/GetIpPlugin.m:2:9: fatal error: 'get_ip/get_ip-Swift.h' file
not found
#import <get_ip/get_ip-Swift.h>
        ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

@lotrofans
Copy link
Owner

What are you using to develop your app? VS Code? Btw have you run pod install too?

@gregoryfm
Copy link

@lotrofans I'm with similar error:

When I run the command flutter run I receive this error:

 Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing get_ip (0.2.0)

    -> Installing image_picker (0.0.1)

    -> Installing location (0.0.1)
      - Running pre install hooks
    [!] Unable to determine Swift version for the following pods:

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

When I run from Xcode, I receive this error:
Showing All Messages /ios/Runner/GeneratedPluginRegistrant.m:6:9: 'get_ip/GetIpPlugin.h' file not found
Could you help me?

@Rostanxd
Copy link

Rostanxd commented May 3, 2019

Hello guys when I try to run from Android Studio for IOS I'm getting the next error:

get_ip 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.

What can I do? Do I have to use a specific version of cocoapods or switft?! I'm using 1.6.1 cocoapods version.

@connorwang
Copy link

The missing header file was due to missing "Runner-Bridging-Header.h". The way XCode works is that it detects swift extension for swift files, once it detects them, the swift configuration section will show up in the xcode build setting and automatically prompt you to install swift-oc bridging header.

So the solution is

  1. Add a .swift file to your your ios/Runner directory (don't forget to add it in xcode or otherwise it won't work).

  2. Your xcode will now prompt you to install bridging header. Click yes.

  3. Build your project to make sure it works

  4. Delete the swift file but NOT the "Runner-Bridging-Header.h".

  5. Profit.

@mrdavidrees
Copy link

try adding "use_frameworks!" to the top of your Podfile.

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

No branches or pull requests

6 participants