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

Run on iOS #12

Closed
edufolly opened this issue Mar 27, 2018 · 25 comments
Closed

Run on iOS #12

edufolly opened this issue Mar 27, 2018 · 25 comments

Comments

@edufolly
Copy link

Hi,

when I try to run on iOS simulator, receive this error:

=== BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===
/Users/edufolly/gigalink/sra/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'barcode_scan/BarcodeScanPlugin.h' file not found
#import <barcode_scan/BarcodeScanPlugin.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
@GokulDharumar
Copy link

GokulDharumar commented Mar 29, 2018

I also have the same issue. Its failing to run on ios.
@edufolly any updates or work around you found for the issue

@edufolly
Copy link
Author

@GokulDharumar nothing yet. I believe the developers will resolve this issue as soon as possible.

@GokulDharumar
Copy link

@edufolly thanks

@maxgfr
Copy link

maxgfr commented Apr 17, 2018

I've the same issue.

@joshdaquino
Copy link

I'm having the same issue.

@Smithguy86
Copy link

Smithguy86 commented May 11, 2018

Make sure the below is placed in the runner/Info.plist file:

iOS
To use on iOS, you must add the the camera usage description to your Info.plist

< key >NSCameraUsageDescription< /key >
< string >Camera permission is required for barcode scanning.< /string >

(Added spaces to key and string so it shows)

Also check flutter doctor to make sure everything is installed correctly.

@04fsnape
Copy link

04fsnape commented May 28, 2018

Did you ever get this working?

@edufolly @maxgfr @joshdaquino

@rcagantas
Copy link

I did. Flutter upgrade. Remove Pods and Podfile and then rebuild.

@04fsnape
Copy link

@rcagantas I'm quite new to this so could you please help me do that? It'd be great if you could show me exactly what commands you typed. Thanks.

@rcagantas
Copy link

rcagantas commented May 30, 2018

If I remember correctly, inside your project folder
flutter clean
flutter upgrade
cd ios
rm Podfile.lock
rm Podfile
rm -r Pods
cd ..
flutter build

I may have created a new test project just to copy a new generated Podfile. I still get warnings but no more errors at least.

@matthewtsmith
Copy link
Contributor

The most common reason this happens is that flutter build does not run the Pod Install step during the build process. I think @rcagantas steps will work, however I don't recommend removing the Podfile, just the Pods folder and Podfile.lock

@04fsnape
Copy link

04fsnape commented May 30, 2018

@rcagantas @matthewtsmith Thanks for your responses. I ran flutter clean and flutter upgrade, but when I cd into ios and try run rm Podfile.lock or rm -r Pods it says "No such file or directory". Have I set something up wrong?

EDIT: I ran Pod Install in my ios directory and then tried, but when I ran rm - r Pods it said "Directory not empty" a bunch of times. Should I just try plug in my phone and do flutter run or do I need to flutter build first?

@matthewtsmith
Copy link
Contributor

If that directory is not there it means that pod install definitely hasn't run. What is the output when you run a flutter build?

@04fsnape
Copy link

04fsnape commented May 30, 2018

@matthewtsmith It seems okay now and I think, but when I run it in Xcode I get this error

The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.

even though this is dart... and I cannot find that setting anywhere.

When I run flutter build it asks me to choose aot/apk/bundle/flx/ios, should I run ios?

EDIT: I ran flutter build ios and it gave me the swift language version error again.

@04fsnape
Copy link

@matthewtsmith Sorry for the spam. I just added a blank swift file to Pods and to Runner, and now it is showing SWIFT_VERSION in both of their Build Settings. In Runner it lets me pick 3.3, 4.1 or Unspecified, and in Pods it is set to 3.0 but it's an entry not a dropdown. I tried all combinations but it's still giving me the error. Any ideas?

@04fsnape
Copy link

@matthewtsmith Okay... now it's working after I set the SWIFT_VERSION in simple_permissions too. However, now under simple_permissions I get Swift Compiler Errors:

Flutter/Flutter.h file not found (SimplePermissionsPlugin.h)
Could not build Objective-C module 'simple-permissions'

@matthewtsmith
Copy link
Contributor

Sounds like you are having issues with swift dependencies. For this reason, all the plugins I've created are ObjC because flutter's swift plugin support is still lacking. This falls outside the scope of this plugin. There is much discussion about this topic here.

@tudor07
Copy link

tudor07 commented Dec 30, 2018

@matthewtsmith Can you please re-open this issue ? I have the same problem BarcodeScanPlugin.h not being found.

barcode_scan: 0.0.8

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14.2 18C54, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] Connected device (1 available)

• No issues found!

@marplx
Copy link

marplx commented Feb 5, 2019

I have been stuck on this for a long time. The mistake was silly:
I opened the Xcode project wrongly. Always open the complete ios folder like this:

cd ios
open -a Xcode .

@caffo
Copy link

caffo commented Feb 14, 2019

Thanks @marfnk — that solved it.

@YasserOJ
Copy link

YasserOJ commented May 30, 2019

in your podfile set the minimum ios version to 11 and run it on a device ios 11+

@Renkon117
Copy link

tried all solutions, but not working in iOS, anyone have the same issue?

@alfrejivi
Copy link

Thanks @marfnk , you saved me a lot of time :)

@gotirahul96
Copy link

Still not working please open the tread again ,Thankyou.

@ghost
Copy link

ghost commented Feb 4, 2020

cd ios
open -a Xcode .
thanks @marfnk

this works for me. be careful "Xcode ." (space and dot)

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