Parcelable encountered IOException writing serializable object

04-11 13:17:11.475: D/vpb(22839): MainActivity.onPause() 04-11 13:17:11.590: D/AndroidRuntime(22839): Shutting down VM 04-11 13:17:11.590: W/dalvikvm(22839): threadid=1: thread exiting with uncaught exception (group=0x4001e578) 04-11 13:17:11.595: E/AndroidRuntime(22839): FATAL EXCEPTION: main 04-11 13:17:11.595: E/AndroidRuntime(22839): java.lang.RuntimeException: Parcelable encountered IOException writing serializable object (name = jp.co.ais.game.vpb2014.MainActivity$17$2) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeSerializable(Parcel.java:1176) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeValue(Parcel.java:1130) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeMapInternal(Parcel.java:488) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Bundle.writeToParcel(Bundle.java:1552) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeBundle(Parcel.java:502) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.support.v4.app.FragmentState.writeToParcel(Fragment.java:132) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeTypedArray(Parcel.java:999) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.support.v4.app.FragmentManagerState.writeToParcel(FragmentManager.java:368) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeParcelable(Parcel.java:1151) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeValue(Parcel.java:1070) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeMapInternal(Parcel.java:488) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Bundle.writeToParcel(Bundle.java:1552) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeBundle(Parcel.java:502) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.app.ActivityManagerProxy.activityPaused(ActivityManagerNative.java:1615) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:2302) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.app.ActivityThread.access$1700(ActivityThread.java:117) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:942) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Handler.dispatchMessage(Handler.java:99) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Looper.loop(Looper.java:130) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.app.ActivityThread.main(ActivityThread.java:3691) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.lang.reflect.Method.invokeNative(Native Method) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.lang.reflect.Method.invoke(Method.java:507) 04-11 13:17:11.595: E/AndroidRuntime(22839): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907) 04-11 13:17:11.595: E/AndroidRuntime(22839): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665) 04-11 13:17:11.595: E/AndroidRuntime(22839): at dalvik.system.NativeStart.main(Native Method) 04-11 13:17:11.595: E/AndroidRuntime(22839): Caused by: java.io.NotSerializableException: jp.co.ais.game.vpb2014.MainActivity 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1535) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1143) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:413) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1241) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeFieldValues(ObjectOutputStream.java:1143) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:413) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeHierarchy(ObjectOutputStream.java:1241) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeNewObject(ObjectOutputStream.java:1575) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObjectInternal(ObjectOutputStream.java:1847) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1689) 04-11 13:17:11.595: E/AndroidRuntime(22839): at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:1653) 04-11 13:17:11.595: E/AndroidRuntime(22839): at android.os.Parcel.writeSerializable(Parcel.java:1171) 04-11 13:17:11.595: E/AndroidRuntime(22839): … 24 more 음.. 현재 상태의 정보를 직렬화해서 어딘가에 저장하는모양인데.. 나의 경우는 아래와 같이 Parcelable 를 추가하여 해결했습니다.

public abstract class Action implements Serializable, Parcelable {
	private static final long serialVersionUID = 5825649609421945811L;
	public Action() {}
	public abstract void execute(Object[] args);
}
덕분에 아래 2개의 메소드를 오버라이드 하지 않으면 안되게 되었습니다만…
	@Override
	public int describeContents() {
		return 0;
	}
	@Override
	public void writeToParcel(Parcel dest, int flags) {
	}
]]>

Related Posts