Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android

Raghav Singh
Raghav Singh
1,548 Points

Fatal Exception: main (BadParcelableException)

07-19 11:52:39.031 8971-8971/com.raghavsingh.stormy D/AndroidRuntime: Shutting down VM
07-19 11:52:39.031 8971-8971/com.raghavsingh.stormy E/AndroidRuntime: FATAL EXCEPTION: main
                                                                      Process: com.raghavsingh.stormy, PID: 8971
                                                                      java.lang.RuntimeException: Unable to start activity ComponentInfo{com.raghavsingh.stormy/com.raghavsingh.stormy.ui.DailyForecastActivity}: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called CREATOR on class com.raghavsingh.stormy.weather.Day
                                                                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3254)
                                                                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350)
                                                                          at android.app.ActivityThread.access$1100(ActivityThread.java:222)
                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795)
                                                                          at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                          at android.os.Looper.loop(Looper.java:158)
                                                                          at android.app.ActivityThread.main(ActivityThread.java:7229)
                                                                          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)
                                                                       Caused by: android.os.BadParcelableException: Parcelable protocol requires a Parcelable.Creator object called CREATOR on class com.raghavsingh.stormy.weather.Day
                                                                          at android.os.Parcel.readParcelableCreator(Parcel.java:2436)
                                                                          at android.os.Parcel.readParcelable(Parcel.java:2358)
                                                                          at android.os.Parcel.readParcelableArray(Parcel.java:2466)
                                                                          at android.os.Parcel.readValue(Parcel.java:2318)
                                                                          at android.os.Parcel.readArrayMapInternal(Parcel.java:2614)
                                                                          at android.os.BaseBundle.unparcel(BaseBundle.java:221)
                                                                          at android.os.Bundle.getParcelableArray(Bundle.java:809)
                                                                          at android.content.Intent.getParcelableArrayExtra(Intent.java:6225)
                                                                          at com.raghavsingh.stormy.ui.DailyForecastActivity.onCreate(DailyForecastActivity.java:25)
                                                                          at android.app.Activity.performCreate(Activity.java:6876)
                                                                          at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1135)
                                                                          at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3207)
                                                                          at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3350) 
                                                                          at android.app.ActivityThread.access$1100(ActivityThread.java:222) 
                                                                          at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1795) 
                                                                          at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                          at android.os.Looper.loop(Looper.java:158) 
                                                                          at android.app.ActivityThread.main(ActivityThread.java:7229) 
                                                                          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) 
07-19 11:52:40.941 8971-8971/com.raghavsingh.stormy I/Process: Sending signal. PID: 8971 SIG: 9

The line showing the is:

Parcelable[] parcelables = intent.getParcelableArrayExtra(MainActivity.DAILY_FORECAST);

1 Answer

Durim Kryeziu
Durim Kryeziu
14,002 Points

I think this will anwser your question

http://stackoverflow.com/questions/18548077/parcelable-protocol-requires-a-parcelable-creator-object-called-creator-i-do-ha

so next time please copy your error like Parcelable protocol requires a Parcelable.Creator object called CREATOR on class

past in google and you will find many answers , so not only for this but for all problems that you will have as a developers I think the best developer is not that you know all the things but you know how to search for your solutions :)