Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7175057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:11:59+00:00 2026-05-28T16:11:59+00:00

I am using Facebook’s API to create a new album with a picture from

  • 0

I am using Facebook’s API to create a new album with a picture from my android app but I keep on getting these annoying errors that make no sense. I have done some research but have come up with nothing. Please help!

String albumName = ((TextView)findViewById(R.id.album_name)).getText().toString();
Bundle params = new Bundle();
params.putByteArray("pictures", toByteArray(mediaPath[0])); 
params.putString("name", albumName);
request.request("https://graph.facebook.com/me/albums",params,"POST", new UploadListener(), new Object());

Take a look at my log cat

01-26 15:51:50.501: W/Bundle(616): Key format expected byte[] but value was a java.lang.String. The default value was returned.
01-26 16:07:48.871: D/Facebook-Util(670): POST URL: https://graph.facebook.com/https://graph.facebook.com/me/albums
01-26 16:07:48.891: W/Bundle(670): Key format expected byte[] but value was a java.lang.String. The default value was returned.
01-26 16:07:48.891: W/Bundle(670): Attempt to cast generated internal exception:
01-26 16:07:48.891: W/Bundle(670): java.lang.ClassCastException: java.lang.String
01-26 16:07:48.891: W/Bundle(670): at android.os.Bundle.getByteArray(Bundle.java:1305)
01-26 16:07:48.891: W/Bundle(670): at com.facebook.android.Util.openUrl(Util.java:155)
01-26 16:07:48.891: W/Bundle(670): at com.facebook.android.Facebook.request(Facebook.java:717)
01-26 16:07:48.891: W/Bundle(670): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)
01-26 16:07:49.390: D/dalvikvm(670): GC_CONCURRENT freed 2526K, 57% free 4489K/10311K, external 5789K/6493K, paused 5ms+4ms
01-26 16:07:49.560: W/Bundle(670): Key method expected byte[] but value was a java.lang.String. The default value was returned.
01-26 16:07:49.560: W/Bundle(670): Attempt to cast generated internal exception:
01-26 16:07:49.560: W/Bundle(670): java.lang.ClassCastException: java.lang.String
01-26 16:07:49.560: W/Bundle(670): at android.os.Bundle.getByteArray(Bundle.java:1305)
01-26 16:07:49.560: W/Bundle(670): at com.facebook.android.Util.encodePostBody(Util.java:63)
01-26 16:07:49.560: W/Bundle(670): at com.facebook.android.Util.openUrl(Util.java:182)
01-26 16:07:49.560: W/Bundle(670): at com.facebook.android.Facebook.request(Facebook.java:717)
01-26 16:07:49.560: W/Bundle(670): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)
01-26 16:07:49.570: W/Bundle(670): Key format expected byte[] but value was a java.lang.String. The default value was returned.
01-26 16:07:49.570: W/Bundle(670): Attempt to cast generated internal exception:
01-26 16:07:49.570: W/Bundle(670): java.lang.ClassCastException: java.lang.String
01-26 16:07:49.570: W/Bundle(670): at android.os.Bundle.getByteArray(Bundle.java:1305)
01-26 16:07:49.570: W/Bundle(670): at com.facebook.android.Util.encodePostBody(Util.java:63)
01-26 16:07:49.570: W/Bundle(670): at com.facebook.android.Util.openUrl(Util.java:182)
01-26 16:07:49.570: W/Bundle(670): at com.facebook.android.Facebook.request(Facebook.java:717)
01-26 16:07:49.570: W/Bundle(670): at com.facebook.android.AsyncFacebookRunner$2.run(AsyncFacebookRunner.java:253)
01-26 16:07:49.610: D/dalvikvm(670): GC_FOR_MALLOC freed 258K, 57% free 4445K/10311K, external 5789K/6493K, paused 38ms
01-26 16:07:49.620: I/dalvikvm-heap(670): Grow heap (frag case) to 15.307MB for 2903026-byte allocation
01-26 16:07:49.670: D/dalvikvm(670): GC_FOR_MALLOC freed <1K, 45% free 7280K/13191K, external 5789K/6493K, paused 32ms
01-26 16:07:49.781: D/dalvikvm(670): GC_CONCURRENT freed 4K, 45% free 7280K/13191K, external 5789K/6493K, paused 4ms+5ms
01-26 16:07:54.990: W/dalvikvm(670): threadid=16: thread exiting with uncaught exception (group=0x40015560)
01-26 16:07:54.990: E/AndroidRuntime(670): FATAL EXCEPTION: Thread-19

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T16:12:00+00:00Added an answer on May 28, 2026 at 4:12 pm

    Try replacing:

    params.putByteArray("pictures", toByteArray(mediaPath[0]));
    

    With:

    params.putString("pictures", mediaPath[0]);
    

    It’s clearly not happy with the byte[] so that’s where I’d start. (That’s assuming mediaPath[] is a string array as the name suggests.

    If that doesn’t work, try creating the album first, then adding the pictures, check the solution here for working album creation:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing app using facebook API. When I push 'login' button from my
Using the Facebook API, is there a way of getting a friend's phone/cell number?
I am using Facebook SDK to load the photos from a specific album like
I'm using Facebook graph API for my iPhone app to get a list of
Can I upload photos using Facebook API but not post to wall in Facebook?
I am using Facebook graph API and getting its result in json format.. I
Hello I am using facebook graph api..and trying to display comments of each post..But
I am using facebook graph api to upload photos to existing album in my
I am using Facebook API how i can get userid in facebook from its
I have been using facebook api for a time, but recently there is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.