IOS
vishva92 opened this issue · 7 comments
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
Hi! I am sorry, but I can not reproduce the error. Try flutter doctor and check whether any error occurs or run flutter upgrade.
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.
What are you using to develop your app? VS Code? Btw have you run pod install too?
@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?
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.
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
-
Add a .swift file to your your ios/Runner directory (don't forget to add it in xcode or otherwise it won't work).
-
Your xcode will now prompt you to install bridging header. Click yes.
-
Build your project to make sure it works
-
Delete the swift file but NOT the "Runner-Bridging-Header.h".
-
Profit.
try adding "use_frameworks!" to the top of your Podfile.