Share card tweet failed

android

#1

code:
final Card card = new Card.AppCardBuilder(MainActivity.this)
.imageUri(Uri.fromFile(new File(mPath)))
.iPhoneId(“123456”)
.iPadId(“123456”)
.build();
final Intent intent = new ComposerActivity.Builder(MainActivity.this)
.session(session)
.card(card)
.createIntent();
startActivity(intent);

response:
Post Tweet failed
com.twitter.sdk.android.core.TwitterApiException: HTTP request failed, Status: 400
at com.twitter.sdk.android.core.Callback.onResponse(Callback.java:42)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7329)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)

why that?


#2

A 400 usually means that a bad request was posted to the service. This most often happens with an invalid imageURI - can you try logging it out to Logcat and sharing the results?

-Mike