error: package androidx.core.app does not exist when running flutter blue plugin

5,664

Solution 1

The fullter_blue version 0.6.3+1 has these types of compatibility issues. I prefer you to use the flutter_blue 0.6.2 version as it is most stable and working correctly as per my own experience.

dependencies:
...
flutter_blue: 0.6.2

Solution 2

Unfortunately it seems like the author (@pauldemarco) is not maintaining and releasing the flutter_blue plugin. See this issue

It also seems like several people have moved to use a fork on github (maintained by @boskokg)

I have not tried the fork myself (yet).

Share:
5,664
Adi Firman Ilham
Author by

Adi Firman Ilham

Updated on December 15, 2022

Comments

  • Adi Firman Ilham
    Adi Firman Ilham over 1 year

    I'm working on Flutter and use Flutter blue plugin. Everything ran well at the beginning but suddenly the program can't perform build because of flutter blue plugin version.

        dependencies:
          vector_math: any
          path_provider: ^1.3.0
          flutter:
            sdk: flutter
          flutter_map:
          flutter_blue: ^0.6.3+1
          cupertino_icons: ^0.1.2
    

    this is the error message

        C:\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_blue-0.6.3+1\android\
        src\main\java\com\pauldemarco\flutter_blue\FlutterBluePlugin.java:43:
        error: package androidx.core.app does not exist import androidx.core.app.ActivityCompat;
        ^
        error: package androidx.core.content does not exist
        import androidx.core.content.ContextCompat;