[Bug]: Parcelable warning while unparcelling Place: consumed 800 bytes but 812 expected
Summary
Device info: Emulator Pixel 5 api 33 While retrieving a Place object from the Intent extras in UploadActivity, Android logs error indicating a Parcelable size mismatch:
Unparcelling of Place ... consumed 800 bytes, but 812 expected
This means the number of bytes read from the Parcel does not match the number of bytes written, suggesting a Parcelable serialization/deserialization inconsistency in the Place class.
The app keeps running but place is not read from Intent correctly. Also the logs have been mentioned in isuue #6227
Steps to reproduce
- Have to open the app.
- Go to nearby.
- Select a location from map.
- Click +.
- Selected gallery icon.
- Select a picture.
- Filter logs for "is:error"
Expected behaviour
Parcelable implementation of Place should maintain strict symmetry between:
writeToParcel() createFromParcel()
in order to match the number of consumed bytes exactly matches number written.
Actual behaviour
Parcel reports:
consumed 800 bytes, but 812 expected
indicating a mismatch during object reconstruction.
Device name
PIXEL 5
Android version
ANDROID 13
Commons app version
6.3.0-debug-main~2b70857d4
Device logs
2026-03-12 14:42:12.832 11936-11936 Parcel fr.free.nrw.commons.beta E Unparcelling of Place{name='VSI International School', lang='en', label='SCHOOL', longDescription='VSI International School', location='lat/lng: (26.966,75.7794)', category='', distance='null', siteLinks='Sitelinks{wikipediaLink='https://en.wikipedia.org/wiki/VSI_International_School', commonsLink='', wikidataLink='http://www.wikidata.org/entity/Q30624963'}', pic='', exists='false', entityID='null'} of type VAL_PARCELABLE consumed 800 bytes, but 812 expected. (Explain with AI) android.util.Log$TerribleFailure: Unparcelling of Place{name='VSI International School', lang='en', label='SCHOOL', longDescription='VSI International School', location='lat/lng: (26.966,75.7794)', category='', distance='null', siteLinks='Sitelinks{wikipediaLink='https://en.wikipedia.org/wiki/VSI_International_School', commonsLink='', wikidataLink='http://www.wikidata.org/entity/Q30624963'}', pic='', exists='false', entityID='null'} of type VAL_PARCELABLE consumed 800 bytes, but 812 expected. at android.util.Log.wtf(Log.java:315) at android.util.Slog.wtfStack(Slog.java:245) at android.os.Parcel.readValue(Parcel.java:4350) at android.os.Parcel.-$$Nest$mreadValue(Unknown Source:0) at android.os.Parcel$LazyValue.apply(Parcel.java:4445) at android.os.Parcel$LazyValue.apply(Parcel.java:4404) at android.os.BaseBundle.getValueAt(BaseBundle.java:394) at android.os.BaseBundle.getValue(BaseBundle.java:374) at android.os.BaseBundle.getValue(BaseBundle.java:357) at android.os.BaseBundle.get(BaseBundle.java:696) at android.os.Bundle.getParcelable(Bundle.java:953) at android.content.Intent.getParcelableExtra(Intent.java:8956) at fr.free.nrw.commons.upload.UploadActivity.receiveInternalSharedItems(UploadActivity.kt:767) at fr.free.nrw.commons.upload.UploadActivity.receiveSharedItems(UploadActivity.kt:487) at fr.free.nrw.commons.upload.UploadActivity.checkStoragePermissions(UploadActivity.kt:330) at fr.free.nrw.commons.upload.UploadActivity.onCreate(UploadActivity.kt:233) at android.app.Activity.performCreate(Activity.java:8342) at android.app.Activity.performCreate(Activity.java:8321) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3626) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3782) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:138) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7924) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Screenshots
Would you like to work on the issue?
Yes
can u assign this issue to me , as this is related to issue #5073 which i am currently working on and firstly i would like to fix this and move on the next
Just to confirm, @devendrachoudharycodes, do you use @devendrabhamu12 as an alternate account? If not, @devendrabhamu12 has already offered to work on it.
Yes, @devendrabhamu12 is my alternate account. My main account @devendrachoudharycodes was temporarily unavailable earlier, so I used the alternate account to open the issue. Now that I have regained access to my main account, I prefer to continue contributions only from @devendrachoudharycodes, so I deleted the PR created from the alternate account to avoid confusion.