thingsboard / flutter_thingsboard_app

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

[Path '/api/v1/MWyIaD8wiB8JH1XCX95g/telemetry/api/noauth/oauth2Clients': Not Found], errorCode: 32, status: 404 #119

Closed pj46280 closed 2 months ago

pj46280 commented 2 months ago

I am using this code to test and run the application in Android Studio following docs from here - https://thingsboard.io/docs/mobile/getting-started/. The app is starting but is stuck on this screen.

image

Complete error log -

I/flutter ( 5163):   ERROR │ ThingsboardError: message: [Path '/api/v1/MWyIaD8wiB8JH1XCX95g/telemetry/api/noauth/oauth2Clients': Not Found], errorCode: 32, status: 404
I/flutter ( 5163):   ERROR │ #0      toThingsboardError (package:thingsboard_client/src/error/_thingsboard_error_handler_io.dart:89:18)
I/flutter ( 5163):   ERROR │ #1      HttpInterceptor.onError (package:thingsboard_client/src/interceptor/http_interceptor.dart:104:19)
I/flutter ( 5163):   ERROR │ #2      QueuedInterceptor._handleQueue (package:dio/src/interceptor.dart:401:17)
I/flutter ( 5163):   ERROR │ #3      QueuedInterceptor._handleError (package:dio/src/interceptor.dart:377:5)
I/flutter ( 5163):   ERROR │ #4      DioMixin.fetch.errorInterceptorWrapper.<anonymous closure>.handleError (package:dio/src/dio_mixin.dart:429:22)
I/flutter ( 5163):   ERROR │ #5      new Future.<anonymous closure> (dart:async/future.dart:258:40)
I/flutter ( 5163):   ERROR │ #6      Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
I/flutter ( 5163):   ERROR │ #7      _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
I/flutter ( 5163):   ERROR │ #8      _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
I/flutter ( 5163):   ERROR │ #9      _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
I/flutter ( 5163):   ERROR │ 
I/flutter ( 5163):   ERROR ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
I/flutter ( 5163):   ERROR │ #0   ThingsboardClient.post (package:thingsboard_client/src/thingsboard_client_base.dart:275:7)
I/flutter ( 5163):   ERROR │ #1   <asynchronous suspension>
I/flutter ( 5163):   ERROR │ #2   OAuth2Service.getOAuth2Clients (package:thingsboard_client/src/service/oauth2_service.dart:38:18)
I/flutter ( 5163):   ERROR │ #3   <asynchronous suspension>
I/flutter ( 5163):   ERROR │ #4   TbContext.onUserLoaded (package:thingsboard_app/core/context/tb_context.dart:321:29)
I/flutter ( 5163):   ERROR │ #5   <asynchronous suspension>
I/flutter ( 5163):   ERROR ├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
ybeshkarov commented 2 months ago

Hello @pj46280,

The error means your backend doesn't have the endpoint you're referencing. /api/v1/MWyIaD8wiB8JH1XCX95g/telemetry/api/noauth/oauth2Clients

Normally this API looks like this http://demo.thingsboard.io/swagger-ui/#/o-auth-2-controller/getOAuth2Clients But you have extra /api/v1/MWyIaD8wiB8JH1XCX95g/telemetry for some reason.

Check your app_constants.dart file to make sure you point your endpoint correctly

pj46280 commented 2 months ago

Ok I was not providing a server instance, thanks for the help.

pj46280 commented 2 months ago

Actually I am getting multiple issues while building the apk for the app, its not compatible with current version of flutter, its prompting to update Kotlin version, I have already changed it to latest?