如何修复:java.lang.NullPointerException:在parse.com上锁定== null

时间:2015-01-30 07:57:59

标签: android parse-platform

enter image description here崩溃报告:

 java.lang.NullPointerException: lock == null
0 java.io.Reader.<init> Reader.java:64
1 java.io.InputStreamReader.<init> InputStreamReader.java:122
2 java.io.InputStreamReader.<init> InputStreamReader.java:59
3 com.parse.ot.run PushConnection.java:693

这次事故发生了19次。我做错了什么???

是我从服务器使用解析查询的方法。我认为&#34; e&#34;不是空的,但我完全不知道。 Evereday我的应用程序丢失了用户。请帮忙!

 public void preferenceFromParce(final AboutDialog aboutDialog, final MainActivity activity) {
        if (ServerAccess.isConnected()) {
            String key = "R" + getSHA1().replace(":", "");
            String objectName = PConst.getPreferenceObject();
            ParseQuery<ParseObject> query = ParseQuery.getQuery(key);
            query.getInBackground(objectName, new GetCallback<ParseObject>() {
                public void done(ParseObject object, ParseException e) {
                    if (e == null) {
                        TinyDB tinyDB = new TinyDB(App.getContext());
                        tinyDB.remove(PConst.PLANT_PREFERENCE);
                        new PlantPreference().savePreferences(object);
                        checkAppPresent(activity);
                        activity.selectVisibility(PConst.SETTINGS_FRAGMENT);
                        activity.selectItem(PConst.SETTINGS_FRAGMENT);
                        aboutDialog.dismiss();
                    } else {
                        Toast.makeText(App.getContext(), App.getContext().getResources().getString(R.string.update_error), Toast.LENGTH_LONG).show();
                    }
                }
            });
        } else
            Toast.makeText(App.getContext(), App.getContext().getResources().getString(R.string.no_connection), Toast.LENGTH_LONG).show();
    }

我也使用了proguard和一些规则:

-dontwarn com.parse.** 
-keep class com.parse.** { ; } 
-keep class com.splunk.mint.* { ; } 
-dontwarn com.google.android.gms.* 
-keep class com.google.android.gms.** { *; } 

1 个答案:

答案 0 :(得分:0)