thingsboard / flutter_thingsboard_pe_app

ThingsBoard PE Mobile Application
https://thingsboard.io/products/mobile-pe/
BSD 3-Clause "New" or "Revised" License
87 stars 69 forks source link

Error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?' #102

Closed Tomi05-k closed 2 months ago

Tomi05-k commented 3 months ago

Hello everyone, Unfortunately, I keep getting stuck with this error:

`Hallo Running Xcode build...
Xcode build done. 27,5s Failed to build iOS app Could not build the precompiled application for the device. Error (Xcode): lib/modules/dashboard/dashboard.dart:157:33: Error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'. Error launching application on iPhone 13 Pro von Tom.

What is the problem here? I am looking forward to your help. Best regards Tom!

Allwhy commented 3 months ago

Hey Tom, I am building for Android, but ran into the same issue a few days ago. Changing Uri.parse('*') to WebUri.uri(Uri.parse('*')) (or accordingly based on current expression) did the job for me. I assume this might be due to some library version incompatibilities... but I didn't investigate further. This is just a quick fix.

Tomi05-k commented 3 months ago

Cool thanks, that works, unfortunately there is still a second problem:

initialUrlRequest: URLRequest(url: _initialUrl),

Error (Xcode): lib/modules/dashboard/dashboard.dart:296:60: Error: The argument type 'Uri' can't be assigned to the parameter type 'WebUri?'.

Do you think this is just a small thing?

Allwhy commented 3 months ago

Yep, basically the same issue. You need to change it to URLRequest(url: WebUri.uri(_initialUrl))

Tomi05-k commented 3 months ago

I have tried a lot again, your tips have also helped, but there are now two more errors. Namely these:

lib/utils/services/widget_action_handler.dart:290:29: Error: The argument type 'List?' can't be assigned to the parameter type 'List' because 'List?' is nullable and 'List' isn't.

FAILURE: Build completed with 2 failures.

Allwhy commented 2 months ago

I would strongly suggest you to just google these things. These are very basic issues that come up during the debugging of any code. I genuinely think that this would help you more than just me providing you with an answer :)

ybeshkarov commented 2 months ago

Hello all,

The Flutter version 3.19.6 is currently officially supported. So I recommend using this version so far, or you can use https://fvm.app/