rekabhq / background_locator

A Flutter plugin for updating location in background.
MIT License
288 stars 329 forks source link

Unhandled Exception: Failed assertion: boolean expression must not be null #175

Closed komape closed 3 years ago

komape commented 3 years ago

When I invoke BackgroundLocator.registerLocationUpdate() the following exception flies:

E/flutter (25352): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Failed assertion: boolean expression must not be null
E/flutter (25352): #0      BackgroundLocator.registerLocationUpdate
package:background_locator/background_locator.dart:33

Flutter Doctor

[✓] Flutter (Channel stable, 1.22.5, on Linux, locale en_US.UTF-8)
    • Flutter version 1.22.5 at /home/username/tools/flutter
    • Framework revision 7891006299 (3 weeks ago), 2020-12-10 11:54:40 -0800
    • Engine revision ae90085a84
    • Dart version 2.10.4

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
    • Android SDK at /home/username/tools/Android/Sdk
    • Platform android-30, build-tools 30.0.2
    • ANDROID_HOME = /home/username/tools/Android/Sdk
    • Java binary at: /usr/local/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Android Studio (version 3.6)
    • Android Studio at /usr/local/android-studio
    • Flutter plugin version 49.0.1
    • Dart plugin version 192.8052
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] Connected device (2 available)
    • ONEPLUS A6013 (mobile)  • ed8b7df2      • android-arm64 • Android 10 (API 29)
    • sdk gphone x86 (mobile) • emulator-5554 • android-x86   • Android 11 (API 30) (emulator)

• No issues found!

background_locator version: 1.1.11+1

komape commented 3 years ago

The boolean autoStop is an optional method parameter. It should either be marked as @required or get a default value.

mehdok commented 3 years ago

@komape Thank you for opening an issue.

I saw the issue notification and somehow I managed to forget about it :) Anyway, thanks for your contribution;