gpt4 book ai didi

使用 SyncAdapter 的 java.lang.VerifyError

转载 作者:行者123 更新时间:2023-12-01 12:54:35 26 4
gpt4 key购买 nike

我正在使用本教程开发一个应用程序:http://udinic.wordpress.com/2013/07/24/write-your-own-android-sync-adapter/以及此存储库中的代码:https://github.com/Udinic/SyncAdapter .

但是当我尝试触发同步过程时,我收到 java.lang.VerifyError

06-02 17:42:56.311  19517-19517/cz.package.name.app W/dalvikvm﹕ VFY: unable to resolve exception class 168 (Landroid/os/OperationCanceledException;)
06-02 17:42:56.311 19517-19517/cz.package.name.app W/dalvikvm﹕ VFY: unable to find exception handler at addr 0xc3
06-02 17:42:56.311 19517-19517/cz.package.name.app W/dalvikvm﹕ VFY: rejected Lcz/package/name/app/syncadapter/RecordSyncAdapter;.onPerformSync (Landroid/accounts/Account;Landroid/os/Bundle;Ljava/lang/String;Landroid/content/ContentProviderClient;Landroid/content/SyncResult;)V
06-02 17:42:56.311 19517-19517/cz.package.name.app W/dalvikvm﹕ VFY: rejecting opcode 0x0d at 0x00c3
06-02 17:42:56.311 19517-19517/cz.package.name.app W/dalvikvm﹕ VFY: rejected Lcz/package/name/app/syncadapter/RecordSyncAdapter;.onPerformSync (Landroid/accounts/Account;Landroid/os/Bundle;Ljava/lang/String;Landroid/content/ContentProviderClient;Landroid/content/SyncResult;)V
06-02 17:42:56.311 19517-19517/cz.package.name.app W/dalvikvm﹕ Verifier rejected class Lcz/package/name/app/syncadapter/RecordSyncAdapter;
06-02 17:42:56.311 19517-19517/cz.package.name.app D/AndroidRuntime﹕ Shutting down VM
06-02 17:42:56.311 19517-19517/cz.package.name.app W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x40c6e1f8)
06-02 17:42:56.311 19517-19517/cz.package.name.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
java.lang.VerifyError: cz/package/name/app/syncadapter/RecordSyncAdapter
at cz.package.name.app.syncadapter.RecordSyncService.onCreate(RecordSyncService.java:27)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2265)
at android.app.ActivityThread.access$1600(ActivityThread.java:127)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1213)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4507)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:978)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:745)
at dalvik.system.NativeStart.main(Native Method)

我发现没有任何解决方案对我有用。我很乐意提供任何建议!

最佳答案

在某个地方,也许在 onPerformSync() 中,您的代码正在引用 OperationCanceledException。该类仅存在于 API 级别 16+ 上,您似乎正在尝试在较旧的 Android 设备上使用它。

关于使用 SyncAdapter 的 java.lang.VerifyError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23998540/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com