今天我一直在處理這個問題,我仍然找不到任何解決方案。我有一個App Engine連接的Android項目,可以通過端點調用GAE數據存儲,也可以使用AmazonS3Client調用AWS S3。我到了必須將照片文件從相機上傳到S3及其各自的元數據到數據存儲實體(Photo.java)的時候。不幸的是,儘管我認爲我的代碼是正確的,我不能運行示例,因爲有定義一個類,這可能是AWS-Android的SDK-XXX-debug.jar和GAE的客戶端之一之間的collission多個文件罐子。如何使用GAE/J和AWS S3 jar來設置Android項目?
這裏是我的控制檯日誌:
[2013-10-06 20:15:15 - Dex Loader] Unable to execute dex: Multiple dex files define Lorg/codehaus/jackson/Base64Variant;
[2013-10-06 20:15:15 - moodstream_final] Conversion to Dalvik format failed: Unable to execute dex: Multiple dex files define Lorg/codehaus/jackson/Base64Variant;
我可以在這種情況下怎麼辦?我不想搞亂從GAE導入的默認罐子,我不知道要從aws庫中導入什麼來避免這種碰撞。
編輯
我也嘗試導入只有AWS-Android的SDK-X.X.X-s3.jar而不是整個調試罐子。該計劃現已運行,但是當是時候創建AmazonS3Client我得到以下錯誤:
10-07 02:07:06.286: E/AndroidRuntime(1917): FATAL EXCEPTION: main
10-07 02:07:06.286: E/AndroidRuntime(1917): java.lang.NoClassDefFoundError: com.amazonaws.services.s3.AmazonS3Client
10-07 02:07:06.286: E/AndroidRuntime(1917): at com.moodstream.activity.CreatePhotoActivity.<init>(CreatePhotoActivity.java:42)
10-07 02:07:06.286: E/AndroidRuntime(1917): at java.lang.Class.newInstanceImpl(Native Method)
10-07 02:07:06.286: E/AndroidRuntime(1917): at java.lang.Class.newInstance(Class.java:1319)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.app.Instrumentation.newActivity(Instrumentation.java:1054)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2097)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.app.ActivityThread.access$600(ActivityThread.java:141)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.os.Handler.dispatchMessage(Handler.java:99)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.os.Looper.loop(Looper.java:137)
10-07 02:07:06.286: E/AndroidRuntime(1917): at android.app.ActivityThread.main(ActivityThread.java:5041)
10-07 02:07:06.286: E/AndroidRuntime(1917): at java.lang.reflect.Method.invokeNative(Native Method)
10-07 02:07:06.286: E/AndroidRuntime(1917): at java.lang.reflect.Method.invoke(Method.java:511)
10-07 02:07:06.286: E/AndroidRuntime(1917): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
10-07 02:07:06.286: E/AndroidRuntime(1917): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
10-07 02:07:06.286: E/AndroidRuntime(1917): at dalvik.system.NativeStart.main(Native Method)
我不明白這一點,因爲AmazonS3Client在S3罐子爲好。因此,仍然卡住:S。