New to Parse, not able to sign up a ParseUser

六眼飞鱼酱① 提交于 2020-01-15 09:13:10

问题


I am just following the basic Parse quickstart guide found here:

https://www.parse.com/apps/quickstart#social/mobile/android/native/new

Everything compiled and ran just fine, but I checked and found that no user was actually being signed up on Parse. I checked the log and here is the error I am getting:

PARSE.COM﹕ FAILEDjava.lang.IllegalArgumentException: Cannot save a ParseUser until it has been signed up. Call signUp first.-1

Here is the code I am working with. As you can see, I just copied the tutorial exactly with the addition of outputting to the Log.

public class ParseApplication extends Application {

  @Override
  public void onCreate() {
  super.onCreate();

  // Initialize Crash Reporting.
  ParseCrashReporting.enable(this);

  // Enable Local Datastore.
  Parse.enableLocalDatastore(this);

  // Add your initialization code here
  Parse.initialize(this, "myappid", "mykey");

  ParseUser.enableAutomaticUser();
  ParseACL defaultACL = new ParseACL();
  // Optionally enable public read access.
  // defaultACL.setPublicReadAccess(true);
  ParseACL.setDefaultACL(defaultACL, true);

  ParseUser user = new ParseUser();
  user.setUsername("my name");
  user.setPassword("my pass");
  user.setEmail("email@example.com");

  // other fields can be set just like with PareObject
  user.put("phone", "650-555-0000");

  user.signUpInBackground(new SignUpCallback() {
        public void done(ParseException e) {
            if (e == null) {
                Log.e("PARSE.COM", "SUCCESS");
            } else {
                Log.e("PARSE.COM","FAILED" + e.getMessage() + Integer.toString(e.getCode()));
                // Sign up didn't succeed. Look at the ParseException
                // to figure out what went wrong
            }
        }
    });
    }
  }

I don't understand why the error is prompting me to call signUp first, is that not exactly I am doing with signUpInBackground? Any help would be greatly appreciated.


回答1:


it looks like a same bug. https://developers.facebook.com/bugs/426365424187686/ if you delete "Parse.enableLocalDatastore(this);" it will be work fine. (API level doesn't matter) and.. they assured me that they will fix the bug with next release. but despite of updates(1.8.2->1.9.0) it is remained yet.

i'm sorry about my broken english.



来源:https://stackoverflow.com/questions/29315002/new-to-parse-not-able-to-sign-up-a-parseuser

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!