Skip to content

Calling ParseUser user = await ParseUser.currentUser(); results in error #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
elpitaj opened this issue Dec 7, 2019 · 6 comments
Closed

Comments

@elpitaj
Copy link

elpitaj commented Dec 7, 2019

Im not sure why Im seeing this error. Any help would be appreciated

[VERBOSE-2:ui_dart_state.cc(148)] Unhandled Exception: NoSuchMethodError: The method 'getString' was called on null.
Receiver: null
Tried calling: getString("flutter_parse_sdk_user")
#0 Object.noSuchMethod (dart:core-patch/object_patch.dart:51:5)
#1 ParseUser._getUserFromLocalStore (package:parse_server_sdk/src/objects/parse_user.dart:333:45)

#2 ParseUser.currentUser (package:parse_server_sdk/src/objects/parse_user.dart:119:20)

#3 UserRepository.getUser (package:la_c/models/user_repository.dart:34:27)

#4 new UserRepository (package:la_c/models/user_repository.dart:27:5)
#5 MyApp.build (package:la_c/main.dart:83:45)
#6 StatelessElement.build (package:flutter/src/widgets/framework.dart:4009:28)
#7 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3941:15)
#8 Element.rebuild (package:flutter/src/widgets/framework.dart:3738:5)
#9 Compo<…>

@aBuder
Copy link

aBuder commented Dec 13, 2019

Can you post content of flutter doctor your pubspec.yml and also the function where you call ParseUser.currentUser()

@israelmarmar
Copy link

I have the same problem.

@RodrigoSMarques
Copy link
Contributor

No problem here. Can you post the startup code of Parse and the call where the error occurs?

@israelmarmar
Copy link

israelmarmar commented Dec 27, 2019

Here
var user = await ParseUser.currentUser() as ParseUser;

E/flutter (26268): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: NoSuchMethodError: The method 'getString' was called on null.
Syncing files to device
E/flutter (26268): Receiver: null
Syncing files to device
E/flutter (26268): Tried calling: getString("flutter_parse_sdk_user")
E/flutter (26268): Tried calling: getString("flutter_parse_sdk_user")
Syncing files to device
E/flutter (26268): #0 Object.noSuchMethod (dart:core-patch/object_patch.dart:53:5)
Syncing files to device.
E/flutter (26268): #1 ParseUser._getUserFromLocalStore (package:parse_server_sdk/src/objects/parse_user.dart:348:45)
Syncing files to device
E/flutter (26268): #2 ParseUser.currentUser (package:parse_server_sdk/src/objects/parse_user.dart:126:20)
Syncing files to device

@mregandla
Copy link
Contributor

I am not facing any issues.

coreStore is null in your case. Looks like Parse().initialize() not done properly. Can you please cross-check?

@phillwiggins
Copy link
Member

Can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants