Closed jawand closed 5 years ago
It looks like you're using another plugin that requires the presence of an Activity
on Android and is trying to access it while it's being initialized. This won't work when there's no UI and the app is executing in the background, so you'll need to manually make sure that plugin doesn't get registered. Unfortunately this is a general issue with all background enabled plugins, not just this one.
for me it was keyboard_visibility 0.5.2, maybe it helps....
I have the same issue, the plugin have to manage this: https://github.com/transistorsoft/flutter_background_fetch/blob/master/android/src/main/java/com/transistorsoft/flutter/backgroundfetch/BackgroundFetchPlugin.java#L46
i clone this repo and run the example.. and tried to click register button and still got this.. this is my environment
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15 19A603, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
✗ CocoaPods not installed.
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To install:
sudo gem install cocoapods
[!] Android Studio (version 3.6)
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.45.1)
[✓] Connected device (1 available)
I added this plugin into my project and when I click the Register button to add a GeoFence it throws this exception.
I am running this on Emulator Pixel 2 API 27. But I get the same error on a real device with Noguet 7.1.
Location is Mode is on
High Accuracy
and wifi and mobile data are enabled.This is my
AndroidManifest.xml
this is
Application.java
Any help is appreciated.