chatter icon indicating copy to clipboard operation
chatter copied to clipboard

getting different errors from client.dart

Open pankaj-vaishnaw opened this issue 3 years ago • 8 comments

hello i m trying to learn the same course and project and i m getting diffrent errors..@HayesGordon

Error: The getter 'accessToken' isn't defined for the class 'Future<ConnectGuestUserResponse>'. ../…/client/client.dart:290

  • 'Future' is from 'dart:async'.
  • 'ConnectGuestUserResponse' is from 'package:stream_chat/src/core/api/responses.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/stream_chat-3.3.1/lib/src/core/api/responses.dart'). package:stream_chat/…/api/responses.dart:1 Try correcting the name to the name of an existing getter, or defining a getter or field named 'accessToken'. final guestUserToken = Token.fromRawValue(guestUser.accessToken); ^^^^^^^^^^^

: Error: The getter 'user' isn't defined for the class 'Future<ConnectGuestUserResponse>'. ../…/client/client.dart:292

  • 'Future' is from 'dart:async'.

  • 'ConnectGuestUserResponse' is from 'package:stream_chat/src/core/api/responses.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/stream_chat-3.3.1/lib/src/core/api/responses.dart'). package:stream_chat/…/api/responses.dart:1 Try correcting the name to the name of an existing getter, or defining a getter or field named 'user'. guestUser.user,

              ^^^^
    

: Error: A value of type 'Future<OwnUser>' can't be assigned to a variable of type 'OwnUser?'. ../…/client/client.dart:330

  • 'Future' is from 'dart:async'.

  • 'OwnUser' is from 'package:stream_chat/src/core/models/own_user.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/stream_chat-3.3.1/lib/src/core/models/own_user.dart'). package:stream_chat/…/models/own_user.dart:1 return state.currentUser = connectedUser;

                               ^
    

: Error: The getter 'me' isn't defined for the class 'Future<Event?>'. ../…/client/client.dart:334

  • 'Future' is from 'dart:async'.

  • 'Event' is from 'package:stream_chat/src/core/models/event.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/stream_chat-3.3.1/lib/src/core/models/event.dart'). package:stream_chat/…/models/event.dart:1 Try correcting the name to the name of an existing getter, or defining a getter or field named 'me'. if (event != null) return ownUser.merge(event.me);

                                                    ^^
    

: Error: A non-null value must be returned since the return type 'OwnUser' doesn't allow null. ../…/client/client.dart:342

  • 'OwnUser' is from 'package:stream_chat/src/core/models/own_user.dart' ('../../../Documents/flutter/.pub-cache/hosted/pub.dartlang.org/stream_chat-3.3.1/lib/src/core/models/own_user.dart'). package:stream_chat/…/models/own_user.dart:1

    Future<OwnUser> openConnection() async { ^ 2

FAILURE: Build failed with an exception.

  • Where: Script 'C:\Users\admin\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1070

  • What went wrong:

  • Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command 'C:\Users\admin\Documents\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.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1m 0s Exception: Gradle task assembleDebug failed with exit code 1

pankaj-vaishnaw avatar Jan 29 '22 07:01 pankaj-vaishnaw

I will check out this issue i just have an issue with this project when i clone it says cant find the AndroidMai.xml file

MpresaFamDeveloper avatar Feb 01 '22 19:02 MpresaFamDeveloper

I will check out this issue i just have an issue with this project when i clone it says cant find the AndroidMai.xml file

ya please tell me if get this this i m getting in stream chat flutter core package and all the errors from those auto generated files which is there in this package

pankaj-vaishnaw avatar Feb 05 '22 15:02 pankaj-vaishnaw

Hi @pankaj-vaishnaw this is really strange. Which branch are you trying to use?

HayesGordon avatar Feb 10 '22 08:02 HayesGordon

@MpresaFamDeveloper try removing the android library and running flutter create . to recreate the platform folder

HayesGordon avatar Feb 10 '22 08:02 HayesGordon

It may also be that you have an issue with your Firebase config. Please be sure to use the correct branch, depending on what you want to do, or which video you like to follow. Also, note that there may be breaking changes in the packages used. So be sure to use the versions that are in the relevant branches - if you want to follow it exactly

HayesGordon avatar Feb 10 '22 08:02 HayesGordon

It may also be that you have an issue with your Firebase config. Please be sure to use the correct branch, depending on what you want to do, or which video you like to follow. Also, note that there may be breaking changes in the packages used. So be sure to use the versions that are in the relevant branches - if you want to follow it exactly

but sir i am still in the stream processing which is in the 2nd video . how the firebase could be a problem because I have not started the firebase connection yet please checkout the errors I have shared which are from the stream-chat-flutter-core package

pankaj-vaishnaw avatar Feb 10 '22 08:02 pankaj-vaishnaw

Hi @pankaj-vaishnaw this is really strange. Which branch are you trying to use?

its a second video and the errors are from the package generated files @HayesGordon

pankaj-vaishnaw avatar Feb 10 '22 09:02 pankaj-vaishnaw

Hi @pankaj-vaishnaw this is really strange. Which branch are you trying to use?

@MpresaFamDeveloper try removing the android library and running flutter create . to recreate the platform folder

I did try to run the flutter create command but the same error kept on showing

MpresaFamDeveloper avatar Feb 11 '22 12:02 MpresaFamDeveloper