Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue running app on iPhone/iOS #72

Closed
indyfromoz opened this issue Apr 12, 2018 · 2 comments
Closed

Issue running app on iPhone/iOS #72

indyfromoz opened this issue Apr 12, 2018 · 2 comments

Comments

@indyfromoz
Copy link

indyfromoz commented Apr 12, 2018

Great app and very nice code, thanks so much for sharing ❤️

Grabbing the latest code from the repository and trying to run it from development branch, I am seeing three errors when I do flutter run -d [deviceID] where deviceID is the iOS simulator I run with open -a Simulator. It is a iPhone X with iOS 11.3. My environment is macOS High Sierra 10.13.4, Xcode 9.3 ((E145). Here is the output from flutter run -

Launching lib/main.dart on iPhone X in debug mode...
Running Xcode clean...                                       1.0s
Starting Xcode build...
Xcode build done                                             1.6s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    === BUILD TARGET path_provider OF PROJECT Pods WITH CONFIGURATION Debug ===
    In file included from /Users/indrajit.chakrabarty/Work/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.0/ios/Classes/UrlLauncherPlugin.m:7:
    /Users/indrajit.chakrabarty/Work/flutter/.pub-cache/hosted/pub.dartlang.org/url_launcher-3.0.0/ios/Classes/UrlLauncherPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from /Users/indrajit.chakrabarty/Work/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.1/ios/Classes/SharedPreferencesPlugin.m:5:
    /Users/indrajit.chakrabarty/Work/flutter/.pub-cache/hosted/pub.dartlang.org/shared_preferences-0.4.1/ios/Classes/SharedPreferencesPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
    In file included from /Users/indrajit.chakrabarty/Work/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.0/ios/Classes/PathProviderPlugin.m:5:
    /Users/indrajit.chakrabarty/Work/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-0.4.0/ios/Classes/PathProviderPlugin.h:5:9: fatal error: 'Flutter/Flutter.h' file not found
    #import <Flutter/Flutter.h>
            ^~~~~~~~~~~~~~~~~~~
    1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone X.

flutter doctor prints the following -

➜  inKino git:(development) ✗ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.2.8, on Mac OS X 10.13.4 17E199, locale en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 9.3)
[✓] Android Studio (version 3.1)
[✓] VS Code (version 1.22.1)
[✓] Connected devices (2 available)

• No issues found!
➜  inKino git:(development) ✗

My environment has Cocoapods version 1.5.0 installed.

Anyone have any suggestions for me try, please?

Thanks!

@indyfromoz
Copy link
Author

I did a bit of digging around after opening the issue. It seems flutter beta has issues with Cocoapods version 1.5.0 (version I have installed). I had to follow flutter/flutter#16036 and implement a workaround with the following steps -

  1. Deleted ios/Podfile.lock and ios/Pods.
  2. Switched flutter channel to master (flutter channel master)
  3. Copied contents of https://github.com/flutter/flutter/blob/master/packages/flutter_tools/templates/cocoapods/Podfile-swift in Podfile.
  4. Ran flutter clean followed by flutter run.

Voila 🎉 the app now runs on my iPhone X Sim

@indyfromoz
Copy link
Author

Closing this issue as it is not a problem with inKino code.

filiph added a commit to filiph/hn_app that referenced this issue Jun 4, 2018
Also updates the Podfile to work with Cocoapods 1.5+, using the
workaround explained in roughike/inKino#72 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant