firebase / firebase/snippets-android
Error Logging Event.VIEW_ITEM_LIST with FirebaseAnalytics: Type not supported: class [Landroid.os.Parcelable
- Dominant language
- Java
- Stars
- 817
- Forks
- 429
- Avg merge
- 10d 14h
- Merged PRs (30d)
- 2
Description
Hi Firebase team,
We're trying to log the Event.VIEW_ITEM_LIST using the example Java code provided in the Firebase documentation. Here’s the code we're using:
```
// [START create_items]
Bundle itemJeggings = new Bundle();
itemJeggings.putString(FirebaseAnalytics.Param.ITEM_ID, "SKU_123");
itemJeggings.putString(FirebaseAnalytics.Param.ITEM_NAME, "jeggings");
itemJeggings.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "pants");
itemJeggings.putString(FirebaseAnalytics.Param.ITEM_VARIANT, "black");
itemJeggings.putString(FirebaseAnalytics.Param.ITEM_BRAND, "Google");
itemJeggings.putDouble(FirebaseAnalytics.Param.PRICE, 9.99);
Bundle itemBoots = new Bundle();
itemBoots.putString(FirebaseAnalytics.Param.ITEM_ID, "SKU_456");
itemBoots.putString(FirebaseAnalytics.Param.ITEM_NAME, "boots");
itemBoots.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "shoes");
itemBoots.putString(FirebaseAnalytics.Param.ITEM_VARIANT, "brown");
itemBoots.putString(FirebaseAnalytics.Param.ITEM_BRAND, "Google");
itemBoots.putDouble(FirebaseAnalytics.Param.PRICE, 24.99);
Bundle itemSocks = new Bundle();
itemSocks.putString(FirebaseAnalytics.Param.ITEM_ID, "SKU_789");
itemSocks.putString(FirebaseAnalytics.Param.ITEM_NAME, "ankle_socks");
itemSocks.putString(FirebaseAnalytics.Param.ITEM_CATEGORY, "socks");
itemSocks.putString(FirebaseAnalytics.Param.ITEM_VARIANT, "red");
itemSocks.putString(FirebaseAnalytics.Param.ITEM_BRAND, "Google");
itemSocks.putDouble(FirebaseAnalytics.Param.PRICE, 5.99);
// [END create_items]
// [START view_item_list]
Bundle itemJeggingsWithIndex = new Bundle(itemJeggings);
itemJeggingsWithIndex.putLong(FirebaseAnalytics.Param.INDEX, 1);
Bundle itemBootsWithIndex = new Bundle(itemBoots);
itemBootsWithIndex.putLong(FirebaseAnalytics.Param.INDEX, 2);
Bundle itemSocksWithIndex = new Bundle(itemSocks);
itemSocksWithIndex.putLong(FirebaseAnalytics.Param.INDEX, 3);
Bundle viewItemListParams = new Bundle();
viewItemListParams.putString(FirebaseAnalytics.Param.ITEM_LIST_ID, "L001");
viewItemListParams.putString(FirebaseAnalytics.Param.ITEM_LIST_NAME, "Related products");
viewItemListParams.putParcelableArray(FirebaseAnalytics.Param.ITEMS,
new Parcelable[]{itemJeggingsWithIndex, itemBootsWithIndex, itemSocksWithIndex});
mFirebaseAnalytics.logEvent(FirebaseAnalytics.Event.VIEW_ITEM_LIST, viewItemListParams);
```
E Internal error - Function call: __md_main
Type not supported: class [Landroid.os.Parcelable;
E Internal error - Function call: __md_main
Type not supported: class [Landroid.os.Parcelable;
E Internal error - Function call: __fm_sendFirebaseEvent
Type not supported: class [Landroid.os.Parcelable;
It seems like `Parcelable[]` isn't supported when logging the `ITEMS` parameter. We're following the documentation, but we're not sure what's going wrong here. Could you clarify how to correctly log a `VIEW_ITEM_LIST` event with multiple items using Firebase Analytics in Java?
Thanks in advance for your help!
Best regards
Contributor guide
Research direction
Start with the VIEW_ITEM_LIST Java snippet shown in the issue and trace how the ITEMS parameter is represented in the Firebase Analytics example. Compare that representation with the supported event-parameter types and any existing snippets for multiple items. Done means the documented example can log a multi-item VIEW_ITEM_LIST event without the reported Parcelable[] error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- firebase, java
- Domain
- documentation, mobile
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100