Logcat 错误消息-试图用非零计数来破坏屏障

我正在 Android Studio 中开发一个 Android 应用程序,集成了 ParseCloud,当我试图从云中检索一些 JSONObject时,在步骤调试之后我得到了这个错误消息:

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)

问题出现在 Java中的这段代码中,准确地说是在 while行:

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;
}

正如我在调试过程中看到的,我等待的对象被创建并且只有一个条目,但是当这种情况发生时,我有点迷失了... ... 任何指导都将是伟大的,非常感谢!

3830 次浏览

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!