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

Using Config File generates Exception after updating to 3.7.0: MissingPluginException no implementation found for method #22

Open
Smibser opened this issue Apr 11, 2022 · 11 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation question Further information is requested

Comments

@Smibser
Copy link

Smibser commented Apr 11, 2022

Since I updated flutter_segment to 3.7.0 I get the following exception on app start when I call Segment.config(...)
Screen Shot 2022-04-11 at 11 56 20 AM

The last working version is 3.3.0

@danielgomezrico danielgomezrico changed the title Exception after updating to 4.7.0 Exception after updating to 3.7.0 Apr 11, 2022
@danielgomezrico
Copy link
Contributor

@Smibser please share some info from your environment, can you show us your pubspec and the flutter doctor output?

@Smibser
Copy link
Author

Smibser commented Apr 12, 2022

Oh yeah of course.

pubspec.yaml

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  flutter_bloc: ^8.0.1
  bloc_concurrency: ^0.2.0
  equatable: ^2.0.2
  flutter_secure_storage: ^5.0.2
  dio: ^4.0.0
  intl: ^0.17.0
  time_machine: ^0.9.16
  url_launcher: ^6.0.6
  cupertino_icons: ^1.0.2
  decimal: ^2.0.0
  flutter_svg: ^0.23.0+1
  backend_api:
    path: api/backend-api
  flutter_html: ^2.1.0
  shared_preferences: ^2.0.11
  flutter_dialogs: ^2.1.0
  sentry_flutter: ^6.2.0
  wakelock: ^0.5.6
  package_info_plus: ^1.3.0
  flutter_appauth: 1.1.0+1 # Fixed version because of https://github.com/MaikuB/flutter_appauth/issues/256
  flutter_segment: 3.3.0 # Fixed version because of https://github.com/la-haus/flutter-segment/issues/22
  cached_network_image: ^3.1.0+1
  flutter_local_notifications: ^9.1.5
  timezone: ^0.8.0
  device_info: ^2.0.3
  flutter_native_timezone: ^2.0.0
  keyboard_dismisser: ^2.0.0
  rxdart: ^0.27.3
  launchdarkly_flutter_client_sdk: ^1.0.0
  fake_async: ^1.2.0
  audioplayers: ^0.20.1
  provider: ^6.0.1
  video_player: ^2.2.10
  touch_indicator: ^2.0.0
  flutter_webview_plugin: ^0.4.0
  invalid:
    git:
      url: https://github.com/CodingPassion-net/invalid.git
  firebase_dynamic_links: ^4.1.1
  dotted_border: ^2.0.0+1

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_driver:
    sdk: flutter
  integration_test:
    sdk: flutter
  flutter_launcher_icons: ^0.9.0
  flutter_native_splash: ^1.1.8+4
  network_image_mock: ^2.0.1
  bloc_test: ^9.0.1
  mockito: ^5.0.16

flutter doctor -v

[] Flutter (Channel stable, 2.10.4, on macOS 12.2.1 21D62 darwin-x64, locale en-DE)
    • Flutter version 2.10.4 at /Users/./development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c860cba910 (3 weeks ago), 2022-03-25 00:23:12 -0500
    • Engine revision 57d3bac3dd
    • Dart version 2.16.2
    • DevTools version 2.9.2

[] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/./Library/Android/sdk
    • Platform android-32, build-tools 30.0.3
    • ANDROID_HOME = /Users/./Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
    • All Android licenses accepted.

[] Xcode - develop for iOS and macOS (Xcode 13.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • CocoaPods version 1.11.3

[] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[] Android Studio (version 2021.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)

[] IntelliJ IDEA Ultimate Edition (version 2020.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[] VS Code (version 1.65.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.38.1

[] Connected device (2 available)
    • iPhone 13 (mobile) • 9ABDFA93-B9CF-45DE-A860-E1023FF33AB9 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 100.0.4896.75

[] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@ariefwijaya
Copy link
Contributor

ariefwijaya commented Apr 16, 2022

@Smibser Please run
flutter clean
flutter pub get
then
Run the project

@danielgomezrico
Copy link
Contributor

danielgomezrico commented Apr 18, 2022

if what @ariefwijaya dont work, can you share a working example that reproduce the issue? I am not able to reproduce it

@limonadev
Copy link

The problem appears when there are configuration keys in the Info.plist file (the deprecated ones). The PR #94 added a boolean wasSetupFromFile that is causing the problem when there are two setups, from Info.plist and from dart method Segment.config. The solution is to simply remove the configuration keys from Info.plist.

@danielgomezrico
Copy link
Contributor

We should remove the deprecated configs 🤔

@limonadev
Copy link

We probably should add that to the README, and also remove the boolean wasSetupFromFile as the configuration file is no longer needed/supported.

@danielgomezrico danielgomezrico changed the title Exception after updating to 3.7.0 Using Config File generates Exception after updating to 3.7.0 Jun 9, 2022
@danielgomezrico danielgomezrico added bug Something isn't working documentation Improvements or additions to documentation labels Aug 5, 2022
@danielgomezrico
Copy link
Contributor

Mm I see that theres a method that handles this:

+ (SEGAnalyticsConfiguration*)createConfigFromFile {
NSString *path = [[NSBundle mainBundle] pathForResource: @"Info" ofType: @"plist"];
NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile: path];
NSString *writeKey = [dict objectForKey: @"com.claimsforce.segment.WRITE_KEY"];
BOOL trackApplicationLifecycleEvents = [[dict objectForKey: @"com.claimsforce.segment.TRACK_APPLICATION_LIFECYCLE_EVENTS"] boolValue];
BOOL isAmplitudeIntegrationEnabled = [[dict objectForKey: @"com.claimsforce.segment.ENABLE_AMPLITUDE_INTEGRATION"] boolValue];
if(!writeKey) {
return nil;
}
SEGAnalyticsConfiguration *configuration = [SEGAnalyticsConfiguration configurationWithWriteKey:writeKey];
configuration.trackApplicationLifecycleEvents = trackApplicationLifecycleEvents;
if (isAmplitudeIntegrationEnabled) {
[configuration use:[SEGAmplitudeIntegrationFactory instance]];
}
return configuration;
}

@danielgomezrico
Copy link
Contributor

@Smibser the issue happens on which device? android or iOS?

@danielgomezrico danielgomezrico changed the title Using Config File generates Exception after updating to 3.7.0 Using Config File generates Exception after updating to 3.7.0: MissingPluginException no implementation found for method Aug 11, 2023
@danielgomezrico
Copy link
Contributor

danielgomezrico commented Aug 11, 2023

@danielgomezrico
Copy link
Contributor

@limonadev the feature exists for compatibility reasons, its deprecated but it should work, if it is not working... to me we can remove the deprecated code since the warning exists since 2021, feel free to send a contribution :)

@danielgomezrico danielgomezrico added the question Further information is requested label Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants