Skip to content

Have a problem using Local Datastore in Android after parse server migration #490

Closed

Description

@slickker

I request this issue to parse.com/help.
They said you might report this issue to here.

I try migration to my local parse server.
I succeeded development local parse server.
And my android application connect to this server successfully.

But to use Local Datastore has problem.
I'm using local datastore.
This is my code.

  • MyApplication.java
    Parse.enableLocalDatastore(this);
  • userProfileDao.java
    try {
    ParseQuery query = ParseQuery.getQuery(PARSE_OBJECT);
    query.fromLocalDatastore();
    mParseObject = query.getFirst();
    } catch (ParseException e) {
    mParseObject = new ParseObject(PARSE_OBJECT);
    }

In userProfileDao.java,
query.fromLocalDatastore(); <- ERROR.... Caused by: java.lang.IllegalStateException: Method requires Local Datastore. Please refer to Parse#enableLocalDatastore(Context).

Before migration, this is no problem.
Currently, I used Parse SDK version 1.13 and Parse server version 2.1.
Please to solve this problem.

Thanks.

Activity

  1. drew-gross commented on Feb 19, 2016

    @drew-gross
    Contributor
  2. shevkorn commented on Feb 21, 2016

    @shevkorn

    I'm having the same problem, I'm unable to work with local database.

  3. arxidon commented on Feb 22, 2016

    @arxidon

    You need to enable the local datastore inside your initialization command, not before like it used to be.

    Parse.initialize(new Parse.Configuration.Builder(this) .applicationId("yourappid") .clientKey("yourclientkey") .server("serverurl") .enableLocalDataStore() .build() );

  4. shevkorn commented on Feb 23, 2016

    @shevkorn

    thank you, it works. Very appreciated.

  5. wanclem commented on Dec 21, 2016

    @wanclem

    Was having same issue here...Thank you..It worked

  6. rakeshmjiyani commented on Feb 10, 2017

    @rakeshmjiyani

    Work like charm!!

  7. umng commented on Jul 24, 2017

    @umng

    it works. Thanks

  8. SUMIT5321 commented on Dec 6, 2017

    @SUMIT5321

    Thanks, its working

  9. breidest-tbs commented on Dec 18, 2020

    @breidest-tbs

    Oh well it is the end of 2020 and I had the same issue.
    Can someone please update the Android guidelines
    http://docs.parseplatform.org/android/guide/#local-datastore

  10. mtrezza commented on Dec 18, 2020

    @mtrezza
    Member

    Thanks for the reminder @breidest-tbs.

    Would you want to open an issue in the docs repo?
    If you want to go even further, we would gladly review your PR for the docs change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions