After I've read a post on how to work with Pusher, I've decided to include it in my project by adding it to my pubspec.yamal
file. Plugin I want to ilcude is pusher_websocket_flutter
version 0.0.2 like in the tutorial.
This is not about following tutorial and implementing code, I am not even there yet. This issue is related only to integrating library into Flutter, and running the app on the iOS simulator. It doesn't even compile, and if you want you can reproduce the same issue just by adding the plugin to your app.
Approach to fixing a problem:
- First I've specified iOS version in podfile
platform :ios, '9.0'
- Next is to add
ENV['SWIFT_VERSION'] = '4.1'
to specify swift version because this plugin also doesn't work without this
Even with these steps I am not able to compile and this is the error I get:
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
=== BUILD TARGET firebase_analytics OF PROJECT Pods WITH CONFIGURATION Debug ===
/Users/aleksandarlugonja/Desktop/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/pusher_websocket_flutter-0.0.7/ios/Classes/PusherPlugin.m:4:17: error: definition of 'PusherPlugin' must be imported from module 'pusher_websocket_flutter.PusherPlugin' before it is required
@implementation PusherPlugin
^
In module 'pusher_websocket_flutter' imported from /Users/aleksandarlugonja/Desktop/FlutterSDK/flutter/.pub-cache/hosted/pub.dartlang.org/pusher_websocket_flutter-0.0.7/ios/Classes/PusherPlugin.m:2:
/Users/aleksandarlugonja/Desktop/development/MyApp/build/ios/Debug-iphonesimulator/pusher_websocket_flutter/pusher_websocket_flutter.framework/Headers/PusherPlugin.h:3:12: note: previous definition is here
@interface PusherPlugin : NSObject<FlutterPlugin>