mitchhymel / local_notifications

No longer in development -Flutter plugin for creating notifications
BSD 2-Clause "Simplified" License
108 stars 14 forks source link

Throwing unhandled Exception #4

Closed s-bauer closed 6 years ago

s-bauer commented 6 years ago

I'm facing an issue when I want to create a new notification. The notification will be created, but the method throws an exception. Can you please look into this?

It even happens with the most basic usage: LocalNotifications.createNotification( title: "Hello", content: "There" );

E/flutter ( 8948): [ERROR:topaz/lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
E/flutter ( 8948): type '_Future' is not a subtype of type 'Future<int>' where
E/flutter ( 8948):   _Future is from dart:async
E/flutter ( 8948):   Future is from dart:async
E/flutter ( 8948):   int is from dart:core
E/flutter ( 8948): 
E/flutter ( 8948): #0      LocalNotifications.createNotification (package:local_notifications/local_notifications.dart:91:21)
mitchhymel commented 6 years ago

This might be due to strong mode in Dart 2. I had developed this plugin on an older version of dart and flutter. I'll see if I can update this to work on Dart 2 without issues.

mitchhymel commented 6 years ago

This should be fixed with e4310de1f2ed50d71c51ae634801803a8ae6623f , I'll push out an update to the package later in the week and let you know when that's available. Leaving this open until then.

s-bauer commented 6 years ago

@mitchhymel Thank you very much! Sadly, I'm now facing problems when trying to build the flutter application for iOS (see log below). I've never developed for iOS / macOS, so I don't really know how to solve this. Can you please check that too? Thanks

Simons-Mac:mobile_app simonbauer$ flutter run
Running "flutter packages get" in mobile_app...              1.0s
Launching lib/main.dart on iPhone X in debug mode...
Running pod install...                                       0.7s
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (`arm64`)

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Pods/.symlinks/flutter/ios`
    -> Fetching podspec for `local_notifications` from `Pods/.symlinks/plugins/local_notifications-0.0.1/ios`

    Resolving dependencies of `Podfile`

    Comparing resolved specification to the sandbox manifest
      A Flutter
      A local_notifications

    Downloading dependencies

    -> Installing Flutter (1.0.0)

    -> Installing local_notifications (0.0.1)
      - Running pre install hooks
    [!] Pods written in Swift can only be integrated as frameworks; add `use_frameworks!` to your Podfile or target to opt into using it. The Swift Pod being used is: local_notifications

    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer/xcode/target_validator.rb:116:in `block (2 levels) in verify_framework_usage'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer/xcode/target_validator.rb:111:in `each'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer/xcode/target_validator.rb:111:in `block in verify_framework_usage'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer/xcode/target_validator.rb:108:in `each'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer/xcode/target_validator.rb:108:in `verify_framework_usage'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer/xcode/target_validator.rb:38:in `validate!'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:406:in `validate_targets'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/installer.rb:118:in `install!'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/command/install.rb:41:in `run'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/claide-1.0.2/lib/claide/command.rb:334:in `run'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/lib/cocoapods/command.rb:52:in `run'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/gems/cocoapods-1.4.0/bin/pod:55:in `<top (required)>'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/bin/pod:22:in `load'
    /usr/local/Cellar/cocoapods/1.4.0/libexec/bin/pod:22:in `<main>'
Error output from CocoaPods:
↳

    [!] `<PBXGroup UUID=`97C146E51CF9000F007C117D`>` attempted to initialize an object with an unknown UUID. `CF3B75C9A7D2FA2A4C99F110` for attribute: `children`. This can be the result of a merge and  the unknown UUID is being discarded.

    [!] Automatically assigning platform `ios` with version `8.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.
Error running pod install
Error launching application on iPhone X.
mitchhymel commented 6 years ago

I'm also very new to iOS (only have a weekend's worth of experience), so this may take some time to figure out. It's possible the iOS part of the plugin was not prepared properly, as there are other potentially related issues (#5 ). Will try to look into this over the weekend.

s-bauer commented 6 years ago

@mitchhymel Thank you very much. I'll probably help you expanding this library in the future, as it's a must have for flutter and there's nothing similar available yet!

s-bauer commented 6 years ago

Continuing discussion in https://github.com/mitchhymel/local_notifications/issues/5