kmorkos / flutter_photokit

Flutter plugin to interact with iOS PhotoKit
Other
8 stars 15 forks source link

Fatal error on building #2

Closed rogiervandenberg closed 5 years ago

rogiervandenberg commented 5 years ago

When I try to use the plugin, I get this on build:

Launching lib/main.dart on iPhone XS Max in debug mode...
Xcode build done.                                            7.7s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/rogier/DEV/flutter/.pub-cache/git/flutter_photokit-44756eeeec487a686f9c301437a6251dde7877aa/ios/Classes/FlutterPhotokitPlugin.m:2:9: fatal error: 'flutter_photokit/flutter_photokit-Swift.h' file not found
#import <flutter_photokit/flutter_photokit-Swift.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Somehow flutter_photokit/flutter_photokit-Swift.h is not found, any ideas?

kmorkos commented 5 years ago

Hi @rogiervandenberg, can you please include the output of flutter doctor?

Also, do you have use_frameworks! in your Podfile?

rogiervandenberg commented 5 years ago

Sure and thanks Kirollos

can you please include the output of flutter doctor?


Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.13.6 17G65, locale en-NL)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
[✓] Android Studio (version 3.2)
[✓] VS Code (version 1.28.2)
[✓] Connected devices (1 available)

• No issues found!


> Also, do you have `use_frameworks!` in your Podfile?

No, because when I do I get this message:

[!] The 'Pods-Runner' target has transitive dependencies that include static frameworks: (FirebaseFunctions, FirebaseCore, FirebaseAuth, FirebaseDatabase, and FirebaseFirestore)


So.. is there some conflict with FireBase then?  ¯\_(ツ)_/¯
kmorkos commented 5 years ago

I'm not sure exactly, it's not an issue with the plugin, but with the Flutter build. Doing a quick Google search, I see some people were able to resolve this error by reinstalling Flutter so I guess you can try that.

rogiervandenberg commented 5 years ago

I created a new project, based on Swift for iOS (flutter create -i swift) and everything works like a charm now. Not sure why, but many thanks for thinking along! After all a 'fresh start' was the solution 🎉