Google lib を使用して、Android アプリから Google クラウド データストア内を読み書きしようとしています。
ライブラリはこれです: google-api-services-datastore-protobuf-java-v1beta1-rev1-1.0.0
私はすでにこのライブラリを使用する std Java プロジェクトを作成しており、すべてが機能しています。Android でコンパイルしようとすると、次のエラーが発生します。
[2013-07-01 12:54:33 - AndroidDatastore] Dx 1 error; aborting
[2013-07-01 12:54:33 - AndroidDatastore] Conversion to Dalvik format failed with error 1
だから私もソースAPIをインポートしようとしましたが、何百ものエラーが発生しました
しばらくしてこの問題を解決し、Android でアプリケーションを起動しましたが、次の実行時エラーが発生しました。
07-08 11:14:26.002: I/dalvikvm(14946): Could not find method com.google.api.services.datastore.DatastoreV1$Entity.newBuilder, referenced from method it.micrel.androiddatastore.MainActivity.addEntry
07-08 11:14:26.002: W/dalvikvm(14946): VFY: unable to resolve static method 9: Lcom/google/api/services/datastore/DatastoreV1$Entity;.newBuilder ()Lcom/google/api/services/datastore/DatastoreV1$Entity$Builder;
07-08 11:14:26.002: D/dalvikvm(14946): VFY: replacing opcode 0x71 at 0x0002
07-08 11:14:26.002: E/dalvikvm(14946): Could not find class 'com.google.api.services.datastore.client.DatastoreOptions$Builder', referenced from method it.micrel.androiddatastore.MainActivity.connectToDatastore
07-08 11:14:26.002: W/dalvikvm(14946): VFY: unable to resolve new-instance 32 (Lcom/google/api/services/datastore/client/DatastoreOptions$Builder;) in Lit/micrel/androiddatastore/MainActivity;
07-08 11:14:26.002: D/dalvikvm(14946): VFY: replacing opcode 0x22 at 0x0000
07-08 11:14:26.012: I/dalvikvm(14946): Could not find method com.google.api.services.datastore.DatastoreV1$BlindWriteRequest.newBuilder, referenced from method it.micrel.androiddatastore.MainActivity.insertAutoId
07-08 11:14:26.012: W/dalvikvm(14946): VFY: unable to resolve static method 5: Lcom/google/api/services/datastore/DatastoreV1$BlindWriteRequest;.newBuilder ()Lcom/google/api/services/datastore/DatastoreV1$BlindWriteRequest$Builder;
07-08 11:14:26.012: D/dalvikvm(14946): VFY: replacing opcode 0x71 at 0x0000
07-08 11:14:26.012: I/dalvikvm(14946): Could not find method com.google.api.services.datastore.DatastoreV1$Query.newBuilder, referenced from method it.micrel.androiddatastore.MainActivity.listEntry
07-08 11:14:26.012: W/dalvikvm(14946): VFY: unable to resolve static method 16: Lcom/google/api/services/datastore/DatastoreV1$Query;.newBuilder ()Lcom/google/api/services/datastore/DatastoreV1$Query$Builder;
07-08 11:14:26.012: D/dalvikvm(14946): VFY: replacing opcode 0x71 at 0x0000
07-08 11:14:26.012: I/dalvikvm(14946): Could not find method com.google.api.services.datastore.DatastoreV1$RunQueryRequest.newBuilder, referenced from method it.micrel.androiddatastore.MainActivity.runQuery
07-08 11:14:26.012: W/dalvikvm(14946): VFY: unable to resolve static method 21: Lcom/google/api/services/datastore/DatastoreV1$RunQueryRequest;.newBuilder ()Lcom/google/api/services/datastore/DatastoreV1$RunQueryRequest$Builder;
07-08 11:14:26.012: D/dalvikvm(14946): VFY: replacing opcode 0x71 at 0x0000
07-08 11:14:26.012: W/dalvikvm(14946): VFY: unable to find class referenced in signature (Lcom/google/api/services/datastore/client/Datastore;)
07-08 11:14:26.022: W/dalvikvm(14946): VFY: unable to resolve exception class 29 (Lcom/google/api/services/datastore/client/DatastoreException;)
07-08 11:14:26.022: W/dalvikvm(14946): VFY: unable to find exception handler at addr 0x68
07-08 11:14:26.022: W/dalvikvm(14946): VFY: rejected Lit/micrel/androiddatastore/MainActivity;.onCreate (Landroid/os/Bundle;)V
07-08 11:14:26.022: W/dalvikvm(14946): VFY: rejecting opcode 0x0d at 0x0068
07-08 11:14:26.022: W/dalvikvm(14946): VFY: rejected Lit/micrel/androiddatastore/MainActivity;.onCreate (Landroid/os/Bundle;)V
07-08 11:14:26.022: W/dalvikvm(14946): Verifier rejected class Lit/micrel/androiddatastore/MainActivity;
07-08 11:14:26.022: W/dalvikvm(14946): Class init failed in newInstance call (Lit/micrel/androiddatastore/MainActivity;)
07-08 11:14:26.092: D/AndroidRuntime(14946): Shutting down VM
07-08 11:14:26.092: W/dalvikvm(14946): threadid=1: thread exiting with uncaught exception (group=0x40aac210)
07-08 11:14:26.202: E/AndroidRuntime(14946): FATAL EXCEPTION: main
07-08 11:14:26.202: E/AndroidRuntime(14946): java.lang.VerifyError: it/micrel/androiddatastore/MainActivity
07-08 11:14:26.202: E/AndroidRuntime(14946): at java.lang.Class.newInstanceImpl(Native Method)
07-08 11:14:26.202: E/AndroidRuntime(14946): at java.lang.Class.newInstance(Class.java:1319)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.app.Instrumentation.newActivity(Instrumentation.java:1023)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1882)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.app.ActivityThread.access$600(ActivityThread.java:127)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.os.Handler.dispatchMessage(Handler.java:99)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.os.Looper.loop(Looper.java:137)
07-08 11:14:26.202: E/AndroidRuntime(14946): at android.app.ActivityThread.main(ActivityThread.java:4448)
07-08 11:14:26.202: E/AndroidRuntime(14946): at java.lang.reflect.Method.invokeNative(Native Method)
07-08 11:14:26.202: E/AndroidRuntime(14946): at java.lang.reflect.Method.invoke(Method.java:511)
07-08 11:14:26.202: E/AndroidRuntime(14946): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:823)
07-08 11:14:26.202: E/AndroidRuntime(14946): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:590)
07-08 11:14:26.202: E/AndroidRuntime(14946): at dalvik.system.NativeStart.main(Native Method)
07-08 11:14:32.558: I/Process(14946): Sending signal. PID: 14946 SIG: 9
最後に、質問は次のとおりです。
Android から Google クラウド データストアにアクセスするにはどうすればよいですか??
このライブラリは Android と互換性がないと考え始めています...
ありがとうございました