3

Hi As parse beeen officially going to close, I am using an alternative as back4app. So in back4app, documentation says

Use this code and change url instead of https://api.parse.com

Parse.initialize(new Parse.Configuration.Builder(myContext)
.applicationId("YOUR_APP_ID")
.clientKey("YOUR_CLIENT_KEY")
.server("https://parseapi.back4app.com") 

But I couldn't use the above line, as it throws compile error as

com.parse.Pars.Builder Configuration has private access in com.parse.Parse.Configuration in the first line of initialize method.

Then How to change and apply it.

rici
  • 234,347
  • 28
  • 237
  • 341
Shadow
  • 6,864
  • 6
  • 44
  • 93
  • Are you using android sdk 1.13.0? – ChunTingLin May 30 '16 at 01:38
  • I think you are using below 1.13.0, try clean project and rebuild, or check is there any low version jar file. – ChunTingLin May 30 '16 at 08:44
  • i downloaded from [latest parse](https://parse.com/downloads/android/Parse/latest) link. where it mentioned version as 1.13.0 – Shadow May 30 '16 at 10:21
  • it will not work in 1.13.0? let me try by integrating below version. – Shadow May 30 '16 at 10:21
  • even i tried [gradle](https://parse.com/apps/quickstart#parse_data/mobile/android/native/existing) too. compile 'com.parse.bolts:bolts-android:1.+' compile 'com.parse:parse-android:1.+' still no use. – Shadow May 30 '16 at 10:23
  • I think you are using 1.12.0 or 1.13.0 correctly. The sdk version is ok, only these 2 version contain Parse.Configuration. Sorry, I haven't mention that error says you have call the constructor of "Parse.Configuration", and this constructor is a private method. You should call build() to get the Parse.Configuration instance. See have you use build() in your code. Parse.initialize(new Parse.Configuration.Builder(myContext) .applicationId("YOUR_APP_ID") .clientKey("XXX) .server("http://localhost:1337/parse/") .build() ); – ChunTingLin May 30 '16 at 13:44
  • omg. thanks for pointing out mistake.. :) please add as answer.. i will accept it and close this question.. – Shadow May 31 '16 at 05:56

1 Answers1

4

I think you are using 1.12.0 or 1.13.0 correctly. The sdk version is ok, only these 2 version contain Parse.Configuration.

The error says you have called the constructor of "Parse.Configuration", and this constructor is a private method.

You should call build() to get the Parse.Configuration instance. See have you use build() in your code.

Parse.initialize(new Parse.Configuration.Builder(myContext)
    .applicationId("YOUR_APP_ID")
    .clientKey(null)
    .server("http://localhost:1337/parse/") 
    .build()
);
ChunTingLin
  • 970
  • 5
  • 14