thingsboard/flutter_thingsboard_pe_app

setup problem.

Closed this issue · 15 comments

greetings,

if i use version this git clone -b release/1.0.7 https://github.com/thingsboard/flutter_thingsboard_pe_app.git . and i have found some issues ..
image. . please give me solution.

Same problem happened to me aswell after the 3.5 update. We have to wait for them to fix this I believe.

You can fix it by running flutter pub upgrade and then flutter pub get on the project.

And if still this error is there while running flutter pub upgrade then follow this steps:

  • Make a new dependency_overrides under dependencies in pubspec.yaml :
dependency_overrides:
  intl: ^0.17.0-nullsafety.2
  • And then run flutter pub upgrade and flutter pub get.
  • What this will do is: This error is created because of dependency issues with flutter_localization. so this new dependcecy_override will force intl package to stay at 0.17.0 version and flutter_localization will get upgraded to ^9.6.1 and then remove this dependency overrides and add intl in the normal dependencies and then run flutter pub upgrade and flutter pub get. So packages will be upgraded and issue will be fixed.
  • Need more clarification on this issue? Read this : https://stackoverflow.com/questions/66476379/flutter-localizations-from-sdk-depends-on-intl-0-17-0-and-fstore-depends-on-intl

greetings,

if i use version this git clone -b release/1.0.7 https://github.com/thingsboard/flutter_thingsboard_pe_app.git . and i have found some issues .. image. . please give me solution.

Thank you for your explanation.
Running flutter pub upgrade and flutter pub get doesn't fix the problem.

dependency_overrides: intl: ^0.17.0-nullsafety.2
Does fix dependency issues, only some deprecated functions remain.

If I run flutter run this error show up:

../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:179:15: Error: The method 'PageMetrics.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'Object with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_metrics.dart:138:7: Context: This is the overridden method ('copyWith').
class FixedScrollMetrics with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:302:15: Error: The method '_PagePosition.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'ViewportOffset with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_position.dart:92:16: Context: This is the overridden method ('copyWith').
abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:170:13: Error: Required named parameter 'devicePixelRatio' must be provided.
}) : super(
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/fluro-2.0.3/lib/src/fluro_router.dart:134:37: Error: The method 'copyWith' isn't defined for the class 'RouteSettings'.

If I run flutter pub upgrade and flutter pub get after resolving dependencies deprecated functions remain but also 2 more error comes up:

privacy_policy.dart
The named parameter 'tagsList' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'tagsList'.

terms_of_use.dart
The named parameter 'tagsList' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'tagsList'.

Running flutter run after this gives me these errors :

../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:179:15: Error: The method 'PageMetrics.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'Object with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_metrics.dart:138:7: Context: This is the overridden method ('copyWith').
class FixedScrollMetrics with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:302:15: Error: The method '_PagePosition.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'ViewportOffset with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_position.dart:92:16: Context: This is the overridden method ('copyWith').
abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:170:13: Error: Required named parameter 'devicePixelRatio' must be provided.
}) : super(
^
lib/core/auth/signup/privacy_policy.dart:52:27: Error: No named parameter with the name 'tagsList'.
tagsList: [],
^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_html-3.0.0-beta.2/lib/flutter_html.dart:66:3: Context: Found this candidate, but the arguments don't match.
Html.fromDom({
^^^^^^^^^^^^
lib/core/auth/signup/terms_of_use.dart:52:27: Error: No named parameter with the name 'tagsList'.
tagsList: [],
^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_html-3.0.0-beta.2/lib/flutter_html.dart:66:3: Context: Found this candidate, but the arguments don't match.
Html.fromDom({
^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build completed with 2 failures.

How can I resolve these issues?

Thank you for your explanation.
Running flutter pub upgrade and flutter pub get doesn't fix the problem.

dependency_overrides: intl: ^0.17.0-nullsafety.2
Does fix dependency issues, only some deprecated functions remain.

If I run flutter run this error show up:

../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:179:15: Error: The method 'PageMetrics.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'Object with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_metrics.dart:138:7: Context: This is the overridden method ('copyWith').
class FixedScrollMetrics with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:302:15: Error: The method '_PagePosition.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'ViewportOffset with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_position.dart:92:16: Context: This is the overridden method ('copyWith').
abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:170:13: Error: Required named parameter 'devicePixelRatio' must be provided.
}) : super(
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/fluro-2.0.3/lib/src/fluro_router.dart:134:37: Error: The method 'copyWith' isn't defined for the class 'RouteSettings'.

If I run flutter pub upgrade and flutter pub get after resolving dependencies deprecated functions remain but also 2 more error comes up:

privacy_policy.dart
The named parameter 'tagsList' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'tagsList'.

terms_of_use.dart
The named parameter 'tagsList' isn't defined.
Try correcting the name to an existing named parameter's name, or defining a named parameter with the name 'tagsList'.

Running flutter run after this gives me these errors :

../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:179:15: Error: The method 'PageMetrics.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'Object with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_metrics.dart:138:7: Context: This is the overridden method ('copyWith').
class FixedScrollMetrics with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:302:15: Error: The method '_PagePosition.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'ViewportOffset with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_position.dart:92:16: Context: This is the overridden method ('copyWith').
abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:170:13: Error: Required named parameter 'devicePixelRatio' must be provided.
}) : super(
^
lib/core/auth/signup/privacy_policy.dart:52:27: Error: No named parameter with the name 'tagsList'.
tagsList: [],
^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_html-3.0.0-beta.2/lib/flutter_html.dart:66:3: Context: Found this candidate, but the arguments don't match.
Html.fromDom({
^^^^^^^^^^^^
lib/core/auth/signup/terms_of_use.dart:52:27: Error: No named parameter with the name 'tagsList'.
tagsList: [],
^^^^^^^^
../../../../AppData/Local/Pub/Cache/hosted/pub.dev/flutter_html-3.0.0-beta.2/lib/flutter_html.dart:66:3: Context: Found this candidate, but the arguments don't match.
Html.fromDom({
^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build completed with 2 failures.

How can I resolve these issues?

Yes first of all remove both tagList from both files. And then run flutter pub outdated. This will list all the outdated packages. Now just by googling and stackoverflow just try your best to upgrade every package using flutter pub upgrade && flutter pub get. And this errors will go away. And you will be able to successfully flutter run and also login into the dashboard.

And also a note: after a successful run of application. You will be getting 25-30 deprecated warnings. About colour being deprecated. But this will be easily Solved and vscode will give you suggestions just use that and app will work fine.

It worked. Thank you @ronit18 .

how do i fix this error? It's my first-time using flutter and this thingsboard.
../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:179:15: Error: The method 'PageMetrics.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'Object with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_metrics.dart:138:7: Context: This is the overridden method ('copyWith').
class FixedScrollMetrics with ScrollMetrics {
^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:302:15: Error: The method '_PagePosition.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'ViewportOffset with ScrollMetrics.copyWith'.
PageMetrics copyWith({
^
/C:/src/flutter/packages/flutter/lib/src/widgets/scroll_position.dart:92:16: Context: This is the overridden method ('copyWith').
abstract class ScrollPosition extends ViewportOffset with ScrollMetrics {
^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:170:13: Error: Required named parameter 'devicePixelRatio' must be provided.
}) : super(
^
Target kernel_snapshot failed: Exception

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1201

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    java.lang.StackOverflowError (no error message)

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 1m 25s
Running Gradle task 'assembleDebug'... 87.0s
Exception: Gradle task assembleDebug failed with exit code 1

how do i fix this error? It's my first-time using flutter and this thingsboard. ../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:179:15: Error: The method 'PageMetrics.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'Object with ScrollMetrics.copyWith'. PageMetrics copyWith({ ^ /C:/src/flutter/packages/flutter/lib/src/widgets/scroll_metrics.dart:138:7: Context: This is the overridden method ('copyWith'). class FixedScrollMetrics with ScrollMetrics { ^ ../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:302:15: Error: The method '_PagePosition.copyWith' doesn't have the named parameter 'devicePixelRatio' of overridden method 'ViewportOffset with ScrollMetrics.copyWith'. PageMetrics copyWith({ ^ /C:/src/flutter/packages/flutter/lib/src/widgets/scroll_position.dart:92:16: Context: This is the overridden method ('copyWith'). abstract class ScrollPosition extends ViewportOffset with ScrollMetrics { ^ ../../../AppData/Local/Pub/Cache/hosted/pub.dev/preload_page_view-0.1.6/lib/preload_page_view.dart:170:13: Error: Required named parameter 'devicePixelRatio' must be provided. }) : super( ^ Target kernel_snapshot failed: Exception

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • Where:
    Script 'C:\src\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1201
  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

2: Task failed with an exception.

  • What went wrong:
    java.lang.StackOverflowError (no error message)
  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.

BUILD FAILED in 1m 25s Running Gradle task 'assembleDebug'... 87.0s Exception: Gradle task assembleDebug failed with exit code 1

Yes this is the same error, Follow the steps that I have wrote above and it should be solved. You will have to change the dependency manually, then run flutter pub upgrade flutter pub get then you'll get a tagList not found error. Just remove tagList array from both files and error will go away. after that hopefully your project will run and you will be having a working app also you will be having many deprecated code like colour not found just in vscode go in each place and do as vscode suggestion. Follow each and every steps in this issue and you will have a working app.

It worked. Thanks @ronit18 !

ujals commented
Screenshot 2023-08-12 at 11 04 37 AM Screenshot 2023-08-12 at 11 06 36 AM

while running simulator to launch application on macbook air m1(apple silicon), I still have issue regarding "pod installation",that I already installed "cocoapods as well as pod"

hi
i am trying to multiple time give above solutions but still i found some error like this.

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 29s
Exception: Gradle task assembleDebug failed with exit code 1
please give me solution

jch889 commented

Hello

I have this errors

lib/core/context/tb_context.dart:55:14: Error: Too many positional arguments: 1 allowed, but 3 found.
Try removing the extra positional arguments.
_logger.v(message, error, stackTrace);
^
lib/core/context/tb_context.dart:59:14: Error: Too many positional arguments: 1 allowed, but 3 found.
Try removing the extra positional arguments.
_logger.d(message, error, stackTrace);
^
lib/core/context/tb_context.dart:63:14: Error: Too many positional arguments: 1 allowed, but 3 found.
Try removing the extra positional arguments.
_logger.i(message, error, stackTrace);
^
lib/core/context/tb_context.dart:67:14: Error: Too many positional arguments: 1 allowed, but 3 found.
Try removing the extra positional arguments.
_logger.w(message, error, stackTrace);
^
lib/core/context/tb_context.dart:71:14: Error: Too many positional arguments: 1 allowed, but 3 found.
Try removing the extra positional arguments.
_logger.e(message, error, stackTrace);
^
lib/core/context/tb_context.dart:75:16: Error: Too many positional arguments: 1 allowed, but 3 found.
Try removing the extra positional arguments.
_logger.wtf(message, error, stackTrace);

1: Task failed with an exception.

  • Where:
    Script 'D:\src\flutter\packages\flutter_tools\gradle\src\main\groovy\flutter.groovy' line: 1297

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'D:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.

  • What went wrong:
    java.lang.StackOverflowError (no error message)

  • Try:

Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
==============================================================================

BUILD FAILED in 5m 50s
Running Gradle task 'assembleDebug'... 355,5s
Exception: Gradle task assembleDebug failed with exit code 1

any clue of how to solve it?
error: The argument type 'String?' can't be assigned to the parameter type 'String'. (argument_type_not_assignable at [thingsboard_app] lib\modules\alarm\alarms_base.dart:53)
error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. (argument_type_not_assignable at [thingsboard_app] lib\modules\dashboard\dashboard.dart:157)
error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. (argument_type_not_assignable at [thingsboard_app] lib\modules\dashboard\dashboard.dart:222)
error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. (argument_type_not_assignable at [thingsboard_app] lib\modules\dashboard\dashboard.dart:231)
error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. (argument_type_not_assignable at [thingsboard_app] lib\modules\dashboard\dashboard.dart:296)
error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. (argument_type_not_assignable at [thingsboard_app] lib\modules\url\url_page.dart:37)
error: The argument type 'List?' can't be assigned to the parameter type 'List'. (argument_type_not_assignable at [thingsboard_app] lib\utils\services\widget_action_handler.dart:290)
error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. (argument_type_not_assignable at [thingsboard_app] lib\utils\ui\tb_recaptcha.dart:75)
error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. (argument_type_not_assignable at [thingsboard_app] lib\utils\ui\tb_recaptcha.dart:123)

Hello @escalanterj,

Could you provide more details about your development environment?

  • flutter --version
  • Are you developing for Android or iOS? If Android, what is the API version level?
  • If you are using an Android emulator, which ABI did you select?

This information will help us diagnose the issue more effectively. Thank you!

Closed as no response.