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
Get Error TwitterKit/TwitterKit.h file not found #12
Comments
@isoos |
it is @lucyhoang who had the issue, I've just moved it. |
is this issue solved yet? i face this problem today |
I'm also still having this issue. I have tried the above suggestions, but still gives error. Please help!!! |
As @eudangeld mentions - just reference his repo for flutter_twitter_login in your pubspec.yaml. You will also need to ensure your pod's define a platform of 10.1 since the TWTRKit.h is now referenced & his podspec defines a min ios version of 10.1,. You may also need to remove :
then after you have defined a min platform of 10.1 in your podfile, just make a simple change to your pubspec.yaml and save to force a re-download of all your packages. Lastly - you may need to do a pod update flutter_twitter_login so that this downloads the correct git reference and initalises your environment correctly. The only other issue you may experience after you perform all of the above is you may get this error when you try and log into twitter (from a flutter app) :
This is because of new changes to twitter sdk that requires callback urls to be whitelisted - just add the callback URLS to your twitter app and also define the correct CFBundleURLTypes in info.plist with a CFBundleTypeRole defined as Editor. Doing everything above will get flutter_twitter_login working again but the key to this resolution is to now reference eudangeld forked repo. |
This worked like a charm for a Flutter Swift project. but for a Flutter ios project with objective c I still get this error. |
Flutter OBJ-c project requires bridging header support to allow mix of OBJ-c and Swift packages. Just open your project in x-code and create a swift file, this will create the necessary bridging file. |
I didn't create/add a swift file using xcode but it just fixed itself. maybe after a few cleaning of build folder and re fetching the git repo package.. anyway thanks a lot for pointing out here how to fix these issues not mentioned by eudangeld.. huge thanks to eudangeld as well! |
Your welcome, but yes - main 'shout out' -> @eudangeld as his forked repo provides the 'glue' to make this all work. At some stage if you started out with the default Obj-c enabled project - as you add more and more plugins, you will definitely experience the issues of the plugins not working in your iOS project and wont be able to compile, keep my suggestion re: Creation of a bridging file in your 'Flutter resource box' as this will save you endless hours if not days of frustration .... |
Mine now has a bridging header, I guess it just generated by itself maybe or maybe was already there when I created the project before. But right now I'm having an error on my other swift project
|
First approach would be :
Other : The error appears potentially because you have a static library that has been built for a different architecture. I'm assuming you tried to deploy this on a real device ? Do you get the same error if you deploy to a simulator ? Try and include the correct library files for the architecture you are deploying to or ensure the lib you have is packaged to support all architectures. |
Hi @ukrx-xamd I only tried in the simulator, also I am just trying to manually build it for debug not running it yet. I've also tried cleaning the build folder. The weird thing is this error only happens on my desktop mac computer but not on my macbook. How do I add support for swift in my pod file? Is it by using use_frameworks! ? Thank you so much for trying to help my problem. |
Thats bizarre. If you have the same Flutter project running correctly on your macBook (with exactly the same versions plugins in your podfile) but not on your desktop mac . I would check that you have :
To support SWIFT (Changes made in your PODFILE) : 1. Specify minimum Swift version that your swift plugins require , i.e
2. Add a use_frameworks! , i.e
3. Add the minimum swift version that ALL of your SWIFT plugins require , i.e :
i.e :
|
change #import <TwitterKit/TwitterKit.h> to #import <TwitterKit/TWTRKit.h> in file TwitterLoginPlugin.m example:
|
That git gives errors with latest Flutter SDK (1.7.8)
|
@MsXam |
Hi @eudangeld - Since my last post I have gone back to 1.5.4-Hotfix2 & also have your git in pubspec.yaml -
cocoapods = 1.7.4 Thoroughly cleaning project with everything you mentioned above plus also cleaning/removing .packages, .flutter-plugins, .pub-cache, DerivedData, pubspec.lock & also doing a pod deintegrate etc does not resolve the build issues which didnt happen until yesterday upgrading to 1.7.8. Even though 1.7.8 is removed and downgraded to 1.5.4 we still get same issues so something somewhere is corrupt and hasnt been cleaned properly ... Notice also the error below
Podfile sets platform to ioS 11 Defined as : - Main Errors
|
@MsXam |
Because of the nature of the app, unfortunately it is not possible to share the full app. However - removing all instances of the flutter_twitter_login plugin , the app builds successfully and runs (albeit without twitter authentication - I will try and create a skeleton of the app which demonstrates the issue first and then send over. |
@eudangeld - It would appear the issue is related to also trying to add the plugin flutter_tts to any project that has this twitter plugin. Since Flutter_TTS is a swift plugin, and assuming you have an objective C project that cannot be re-created as a swift project - then adding the Flutter_tts requires a couple of extra steps :
Doing the above will get Flutter_tts up and running within your objective c based project. Now lets say you also want to add this twitter plugin to the same project - that is where the issue lies and you get all of the compiler errors shown before. |
@MsXam |
@eudangeld - I still get the problem. Could you share your pubspec so that I can see which twitter plugin/version you are referring to ? Additionally - can you advise if you have TWTR SDK installed and referenced anywhere in your PATH ? Thank you. |
@MsXam I just redo the whole process again and everything worked perfectly. Pubspec.yaml
|
Hi @eudangeld, thanks for the fork. It compiled! I appreciate it :) But still I have an issue on iOS device.
Appreciate your feedback. |
Hi @codxse thanks for the feedback. |
@MsXam |
thanks for the feedback btw, here my Info.plist
as you can see, I have include both |
@codxse |
yes, but I have to change to deploy target version >10.1 |
I know support for this is discontinued, but I did finally get my iOS deployment to work with this.
|
From @lucyhoang on August 23, 2018 2:22
URL: https://pub.dartlang.org/packages/flutter_twitter_login
Hi, when i using this package with setting ios platform is 9, then i will get the error "TwitterKit/TwitterKit.h file not found".
It loaded TwitterKit v3.0 but the code logic using api of TwitterKit v2.8
Copied from original issue: dart-lang/pub-dev#1542
The text was updated successfully, but these errors were encountered: