Bmob使用案例常见异常总结
1. 实体类中变量类型定义出错。
E/AndroidRuntime(32406): FATAL EXCEPTION: main
E/AndroidRuntime(32406): Process: com.blueberry.xinli, PID: 32406
E/AndroidRuntime(32406): g.II: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 46
E/AndroidRuntime(32406): at j.Though$This.Code(SourceFile:176)
E/AndroidRuntime(32406): at g.Tempest.Code(SourceFile:803)
E/AndroidRuntime(32406): at g.Tempest.Code(SourceFile:717)
E/AndroidRuntime(32406): at cn.bmob.v3.requestmanager.thing$3.onSuccess(SourceFile:145)
E/AndroidRuntime(32406): at cn.bmob.v3.requestmanager.thing$1.V(SourceFile:1)
E/AndroidRuntime(32406): at cn.bmob.v3.requestmanager.This.Code(SourceFile:1)
E/AndroidRuntime(32406): at e.I.run(SourceFile:99)
E/AndroidRuntime(32406): at android.os.Handler.handleCallback(Handler.java:808)
E/AndroidRuntime(32406): at android.os.Handler.dispatchMessage(Handler.java:103)
E/AndroidRuntime(32406): at android.os.Looper.loop(Looper.java:193)
E/AndroidRuntime(32406): at android.app.ActivityThread.main(ActivityThread.java:5322)
E/AndroidRuntime(32406): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(32406): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(32406): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
E/AndroidRuntime(32406): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
E/AndroidRuntime(32406): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime(32406): Caused by: java.lang.IllegalStateException: Expected a string but was BEGIN_OBJECT at line 1 column 46
E/AndroidRuntime(32406): at l.This.nextString(SourceFile:821)
E/AndroidRuntime(32406): at j.II.Code(SourceFile:1)
E/AndroidRuntime(32406): at j.Though$1.Code(SourceFile:93)
E/AndroidRuntime(32406): at j.Though$This.Code(SourceFile:172)
E/AndroidRuntime(32406): ... 15 more
可以看到,提示定义类型问题, 我出错在定义的图片url,使用的是string, 然后报错,,,更改成 BmobFile类型,,所以定义好变量类型关键。