parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

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

Open slickker opened this issue 10 years ago • 10 comments

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.

slickker avatar Feb 19 '16 00:02 slickker

cc @grantland

drew-gross avatar Feb 19 '16 00:02 drew-gross

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

shevkorn avatar Feb 21 '16 05:02 shevkorn

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() );

arxidon avatar Feb 22 '16 19:02 arxidon

thank you, it works. Very appreciated.

shevkorn avatar Feb 23 '16 17:02 shevkorn

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

wanclem avatar Dec 21 '16 23:12 wanclem

Work like charm!!

rakeshmjiyani avatar Feb 10 '17 13:02 rakeshmjiyani

it works. Thanks

umng avatar Jul 24 '17 12:07 umng

Thanks, its working

SUMIT5321 avatar Dec 06 '17 14:12 SUMIT5321

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

breidest-tbs avatar Dec 18 '20 08:12 breidest-tbs

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.

mtrezza avatar Dec 18 '20 12:12 mtrezza