0
このランタイムエラーは、アプリケーションをコンパイルして開いた後に時々発生します。:Retrofit 2のNoClassDefFoundErrorエラー
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: VFY: unable to find class referenced in signature (Lretrofit2/Response;)
04-27 17:54:37.442 29161-29161/com.myproject I/dalvikvm: Could not find method retrofit2.Response.body, referenced from method com.myproject.BaseController.hasOkStatus
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: VFY: unable to resolve virtual method 64810: Lretrofit2/Response;.body()Ljava/lang/Object;
04-27 17:54:37.442 29161-29161/com.myproject D/dalvikvm: VFY: replacing opcode 0x6e at 0x0001
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: VFY: unable to find class referenced in signature (Lretrofit2/Response;)
04-27 17:54:37.442 29161-29161/com.myproject I/dalvikvm: Could not find method retrofit2.Response.isSuccess, referenced from method com.myproject.BaseController.parseResult
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: VFY: unable to resolve virtual method 64811: Lretrofit2/Response;.isSuccess()Z
04-27 17:54:37.442 29161-29161/com.myproject D/dalvikvm: VFY: replacing opcode 0x6e at 0x0000
04-27 17:54:37.442 29161-29161/com.myproject I/dalvikvm: Failed resolving Lbr/org/myproject/rest/RestClient$1; interface 8642 'Lokhttp3/Interceptor;'
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: Link of class 'Lbr/org/myproject/rest/RestClient$1;' failed
04-27 17:54:37.442 29161-29161/com.myproject E/dalvikvm: Could not find class 'com.myproject.rest.RestClient$1', referenced from method com.myproject.rest.RestClient.getInstance
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: VFY: unable to resolve new-instance 2661 (Lbr/org/myproject/rest/RestClient$1;) in Lbr/org/myproject/rest/RestClient;
04-27 17:54:37.442 29161-29161/com.myproject D/dalvikvm: VFY: replacing opcode 0x22 at 0x0009
04-27 17:54:37.442 29161-29161/com.myproject I/dalvikvm: Failed resolving Lbr/org/myproject/rest/RestClient$1; interface 8642 'Lokhttp3/Interceptor;'
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: Link of class 'Lbr/org/myproject/rest/RestClient$1;' failed
04-27 17:54:37.442 29161-29161/com.myproject D/dalvikvm: DexOpt: unable to opt direct call 0x51d5 at 0x0b in Lbr/org/myproject/rest/RestClient;.getInstance
04-27 17:54:37.442 29161-29161/com.myproject D/dalvikvm: DexOpt: unable to opt direct call 0xeee1 at 0x10 in Lbr/org/myproject/rest/RestClient;.getInstance
04-27 17:54:37.442 29161-29161/com.myproject I/dalvikvm: DexOpt: unable to optimize static field ref 0x986d at 0x13 in Lbr/org/myproject/rest/RestClient;.getInstance
04-27 17:54:37.442 29161-29161/com.myproject D/dalvikvm: DexOpt: unable to opt direct call 0xee81 at 0x1a in Lbr/org/myproject/rest/RestClient;.getInstance
04-27 17:54:37.442 29161-29161/com.myproject D/dalvikvm: DexOpt: unable to opt direct call 0xfd2d at 0x3d in Lbr/org/myproject/rest/RestClient;.getInstance
04-27 17:54:37.442 29161-29161/com.myproject D/AndroidRuntime: Shutting down VM
04-27 17:54:37.442 29161-29161/com.myproject W/dalvikvm: threadid=1: thread exiting with uncaught exception (group=0x416d5d58)
04-27 17:54:38.342 29161-29161/com.myproject E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.myproject, PID: 29161
java.lang.NoClassDefFoundError: com.myproject.rest.RestClient$1
at com.myproject.rest.RestClient.getInstance(RestClient.java:29)
at com.myproject.features.auth.control.LoginController.<init>(LoginController.java:36)
[編集]ここで問題のあるコードがあります(実際のエラーは、非常に最後の行にのみある)
compile 'com.squareup.retrofit2:retrofit:2.0.0-beta4'
compile 'com.squareup.retrofit2:converter-gson:2.0.0-beta4'
compile 'com.squareup.okhttp3:logging-interceptor:3.0.1'
compile 'com.squareup.okhttp3:okhttp:3.1.2'
compile 'com.google.code.gson:gson:2.6.1'
を、ここでlogcatトレースがあります: は、ここで私はGradleのファイルを持っているものです
はあなたのコードを投稿してください。 – nasch
完了しましたが、私が最初に投稿しなかったのは同じコードが以前に働いていたことです(明らかに) – JayJay
そのコードスニペットにRestClient 29行が含まれていますか?それが問題の場所ですから。そして、それが「前」に働いていたら、それ以来何が変わってきたのか分かりますか? – nasch