Search code examples
flutterflutter-dependenciesthingsboard

Flutter ThingsBoard PE: Dashboards Not Loading on Android API 21-30


I am facing a specific issue while attempting to run my Flutter application with the latest version of ThingsBoard PE (1.0.7) on Android devices with API 21 to 30. The application is not loading dashboards correctly, although it works fine on APIs 31 and 33.

Problem Details:

  • The unexpected behavior can be observed when trying to load dashboards from ThingsBoard PE on devices with API 21, 24, 29, and 30.
  • The application is functioning as expected on APIs 31 and 33.
  • I have simultaneously emulated two devices, one with API 30 and another with API 33, to demonstrate the error, which can be seen in the image attached to this question.

Error image

build.gradle Configuration:

...
android {
    compileSdkVersion 33

    defaultConfig {
        applicationId "org.thingsboard.pe.app"
        minSdkVersion 24
        targetSdkVersion 33
        ...
    }
}
...

Changes made to the app before discovering the bug:

  • Added the 'one_signal' package to enable push notification reception.
  • Translated the app to my country's native language (Brazil, pt-BR).

Attempts made:

  • I have tried updating the flutter packages in the pubspec.yaml file, but it didn't make much difference.
  • I attempted to download the app from the official repository again, but even without modifications, the app already contains several bugs, so I didn't proceed further.

I appreciate the community's assistance in finding a solution to this specific problem of dashboard loading issues on Android devices with API 21 to 30, using ThingsBoard PE version 1.0.7 and the Flutter application.


Solution

  • Solved Bug

    I was able to resolve this bug by removing the comments for these packages in the pubspeck.yaml file:

    • flutter_downloader: ^1.6.0
    • permission_handler: ^8.0.0+2
    • path_provider: ^2.0.2

    I also changed the version of the material icons package

    • material_design_icons_flutter: ^5.0.5955-rc.1 to material_design_icons_flutter: ^7.0.7296

    Furthermore, I carried out tests on real devices and it worked as expected, only in the Android Studio emulator some errors occurred.