Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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;
like image 717
Adi Firman Ilham Avatar asked Oct 29 '19 07:10

Adi Firman Ilham


2 Answers

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
like image 163
Muhammad Sarmad Mahmood Malik Avatar answered Oct 18 '22 19:10

Muhammad Sarmad Mahmood Malik


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

  • https://github.com/pauldemarco/flutter_blue/issues/510

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

  • https://github.com/boskokg/flutter_blue

I have not tried the fork myself (yet).

like image 28
Jakob E. Bardram Avatar answered Oct 18 '22 19:10

Jakob E. Bardram