Android でバイナリ送信時のエラーの回避
Android でバイナリ送信時にエラーが発生したのでその回避方法をメモ。
1.8 RC3 で確認。すぐ修正されるかも。
xhr.send({image : blob});
としてバイナリを送信しようとすると
Could not find class 'org.apache.http.entity.mime.content.FileBody'
とエラーが出る。
SDK 内の dependency.json で thirdparty.jar を読み込むようにしてあげたら回避できた。
Mac なら以下。
/Library/Application Support/Titanium/mobilesdk/osx/1.8.0.1.RC3/android/dependency.json
以下のように "android" の先頭に thirdparty.jar を追加。
でもこれが正しい方法なのかわからない。。
"libraries": { "android":["thirdparty.jar","jaxen-1.1.1.jar","ti-commons-codec-1.3.jar","kroll-common.jar","titanium.jar"], "xml":["jaxen-1.1.1.jar"], "ui":["android-support-v4.jar"] }
2012/02/13 追記
1.8.1 で修正されたようです。
https://github.com/appcelerator/titanium_mobile/pull/1158