Logcat error message - Attempted to destroy barrier with non zero count
Asked Answered
K

1

86

I'm making an android app in Android Studio, integrating ParseCloud and when I try to retrieve some JSONObject from the cloud, I get this error message after step-debugging:

12-13 13:32:34.857 25631-25638/com.parse.starter A/art: art/runtime/barrier.cc:90] Check failed: count_ == 0 (count_=-1, 0=0) Attempted to destroy barrier with non zero count
12-13 13:32:34.858 25631-25638/com.parse.starter A/art: art/runtime/runtime.cc:366] Runtime aborting --- recursively, so no thread-specific detail!
12-13 13:32:34.863 25631-25638/com.parse.starter A/art: art/runtime/runtime.cc:366]
12-13 13:32:34.882 25631-25638/com.parse.starter A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 25638 (JDWP)

Problem arises in this piece of code in ParseDecoder.java, precisely on the while line:

Map<String, Object> convertJSONObjectToMap(JSONObject object) {
    Map<String, Object> outputMap = new HashMap<>();
    Iterator<String> it = object.keys();
    while (it.hasNext()) {
      String key = it.next();
      Object value = object.opt(key);
      outputMap.put(key, decode(value));
    }
    return outputMap;
}

As I've seen while debugging, the object I wait for is created and is filled with one entry, but then this happens and I'm little bit lost... Any guidance will be great, thank you very much!

Kory answered 13/12, 2015 at 14:33 Comment(3)
Hey! Error was on the call I made to the function; I had to write the call like it was an <Object> the returned object. It was working that way. ParseCloud.callFunctionInBackground("usersInDistanceOfGeoPoint", params, new FunctionCallback<Object>() { @Override public void done(Object object, com.parse.ParseException e) { .....Kory
Are you using android:sharedUserId="android.uid.system"?Anthologize
can you also post the contents of decode?Xylotomy
S
1

I've solved the problem. I was using an old version of Parse library and it was interfering with the new one. I've just changed the Parse.initialize() lines to:

Parse.initialize(new Parse.Configuration.Builder(this)
        .applicationId("MY_APP_ID")
        .clientKey("MY_CLIENT_KEY")
        .server("MY_SERVER_URL")
        .build()
);

and it worked!

Shoran answered 1/9, 2022 at 21:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.