Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception with Android O on Deserialization #515

Closed
westnordost opened this issue Jun 4, 2017 · 2 comments
Closed

Exception with Android O on Deserialization #515

westnordost opened this issue Jun 4, 2017 · 2 comments

Comments

@westnordost
Copy link

Objenisis uses the method ObjectStreamClass.getConstructorId which has now been removed for Android O (SDK 25) - that means, an InvocationTargetException is thrown.
This results in making it impossible to use Kryo for deserialization.

There is a ticket already in objenesis easymock/objenesis#52 regarding this issue. When there is a workaround from objenesis, Kryo should probably use the newer release of objenesis to fix this issue.

org.objenesis.ObjenesisException: java.lang.reflect.InvocationTargetException
at org.objenesis.instantiator.android.Android18Instantiator.findConstructorIdForJavaLangObjectConstructor(Android18Instantiator.java:84)
at org.objenesis.instantiator.android.Android18Instantiator.(Android18Instantiator.java:39)
at org.objenesis.strategy.StdInstantiatorStrategy.newInstantiatorOf(StdInstantiatorStrategy.java:96)
at com.esotericsoftware.kryo.Kryo$DefaultInstantiatorStrategy.newInstantiatorOf(Kryo.java:1313)
at com.esotericsoftware.kryo.Kryo.newInstantiator(Kryo.java:1127)
at com.esotericsoftware.kryo.Kryo.newInstance(Kryo.java:1136)
at com.esotericsoftware.kryo.serializers.FieldSerializer.create(FieldSerializer.java:559)
at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:535)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40)
at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:134)
at com.esotericsoftware.kryo.serializers.CollectionSerializer.read(CollectionSerializer.java:40)
at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:709)
at de.westnordost.streetcomplete.util.KryoSerializer.toObject(KryoSerializer.java:88)
at 
@magro
Copy link
Collaborator

magro commented Jun 11, 2017

See also #514

@magro
Copy link
Collaborator

magro commented Jun 11, 2017

Fixed with #514

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants