问题描述
我使用的parseObject保存设计ID为推送通知。这里是我的code
I am using ParseObject for Saving Devise id for Push Notification. Here is My Code
ParseObject Object = new ParseObject("Key");
TelephonyManager tManager =
(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
devicetoken = tManager.getDeviceId();
Object.put("user_objectId", "user_"+devicetoken);
Object.saveInBackground();
但我收到此错误。
But I am getting this error.
03-25 13:10:21.770: E/AndroidRuntime(25196): FATAL EXCEPTION: main
03-25 13:10:21.770: E/AndroidRuntime(25196): Process: com.codenterprise.CashbackKorting, PID: 25196
03-25 13:10:21.770: E/AndroidRuntime(25196): java.lang.VerifyError: com/parse/ParseACL
03-25 13:10:21.770: E/AndroidRuntime(25196): at com.parse.ParseObject.setDefaultValues(ParseObject.java:2764)
03-25 13:10:21.770: E/AndroidRuntime(25196): at com.parse.ParseObject.<init>(ParseObject.java:160)
03-25 13:10:21.770: E/AndroidRuntime(25196): at com.codenterprise.CashbackKorting.Tab.onCreate(Tab.java:111)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.app.Activity.performCreate(Activity.java:5231)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.app.ActivityThread.access$800(ActivityThread.java:135)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.os.Handler.dispatchMessage(Handler.java:102)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.os.Looper.loop(Looper.java:136)
03-25 13:10:21.770: E/AndroidRuntime(25196): at android.app.ActivityThread.main(ActivityThread.java:5017)
03-25 13:10:21.770: E/AndroidRuntime(25196): at java.lang.reflect.Method.invokeNative(Native Method)
03-25 13:10:21.770: E/AndroidRuntime(25196): at java.lang.reflect.Method.invoke(Method.java:515)
03-25 13:10:21.770: E/AndroidRuntime(25196): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
03-25 13:10:21.770: E/AndroidRuntime(25196): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
03-25 13:10:21.770: E/AndroidRuntime(25196): at dalvik.system.NativeStart.main(Native Method)
能否请你帮我找出这个问题?
Can you please help me identify the problem?
推荐答案
考虑增加以下code到您的应用程序启动时(通常在Application.onCreate()):
Consider adding the following code to your application startup (usually in Application.onCreate()):
ParseUser.enableAutomaticUser(); //.If you don't use a custom sign-up method
ParseACL defaultACL = new ParseACL();
// Optionally enable public read access while disabling public write access.
// defaultACL.setPublicReadAccess(true);
ParseACL.setDefaultACL(defaultACL, true);
总之, java.lang.VerifyError
当校验器检测到一个类文件,虽然中规中矩,包含着一些内部不一致性或安全性问题被抛出。
Anyway, java.lang.VerifyError
is thrown when the "verifier" detects that a class file, though well formed, contains some sort of internal inconsistency or security problem.
此异常可能是这个结果的时候的您的都针对不同的库比你使用的是在运行时编译。尝试检查你的库中的所有库(的.jar)
路径是最新版本。例如,如果你只使用解析,尝试检查是否是最新版本,或者如果您正在使用其他库,是建立在解析,检查它们是否使用相同的版本。
This exception could be the result when "you" have compiled against a different library than you are using at runtime. Try to check all the libraries (.jar) in your libs
path are the latest versions. For example, if you are using only Parse, try to check if is the latest release, or if you are using others libraries that are build upon Parse, check if they use the same release.
这篇关于Android版的parseObject java.lang.VerifyError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!