Objenesis broken on Android 4.3?

121 views
Skip to first unread message

smich...@gmail.com

unread,
Aug 2, 2013, 5:14:41 AM8/2/13
to objene...@googlegroups.com
Hello,

I have been using objenesis 1.3 with Java Deep Cloning library (https://code.google.com/p/cloning/) in Android. Recent update to Android 4.3 caused objenesis to break with the following exception:

08-02 11:37:27.613: E/AppContext(4108): org.objenesis.ObjenesisException: java.lang.NoSuchMethodException: newInstance [class java.lang.Class, int]
08-02 11:37:27.613: E/AppContext(4108): at org.objenesis.instantiator.android.AndroidInstantiator.getNewInstanceMethod(AndroidInstantiator.java:62)
08-02 11:37:27.613: E/AppContext(4108): at org.objenesis.instantiator.android.AndroidInstantiator.<init>(AndroidInstantiator.java:38)
08-02 11:37:27.613: E/AppContext(4108): at org.objenesis.strategy.StdInstantiatorStrategy.newInstantiatorOf(StdInstantiatorStrategy.java:75)
08-02 11:37:27.613: E/AppContext(4108): at org.objenesis.ObjenesisBase.getInstantiatorOf(ObjenesisBase.java:90)
08-02 11:37:27.613: E/AppContext(4108): at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73)
08-02 11:37:27.613: E/AppContext(4108): at com.rits.cloning.ObjenesisInstantiationStrategy.newInstance(ObjenesisInstantiationStrategy.java:18)
08-02 11:37:27.613: E/AppContext(4108): at com.rits.cloning.Cloner.newInstance(Cloner.java:287)
08-02 11:37:27.613: E/AppContext(4108): at com.rits.cloning.Cloner.cloneInternal(Cloner.java:468)
08-02 11:37:27.613: E/AppContext(4108): at com.rits.cloning.FastClonerArrayList.clone(FastClonerArrayList.java:20)
08-02 11:37:27.613: E/AppContext(4108): at com.rits.cloning.Cloner.fastClone(Cloner.java:108)
08-02 11:37:27.613: E/AppContext(4108): at com.rits.cloning.Cloner.cloneInternal(Cloner.java:437)
08-02 11:37:27.613: E/AppContext(4108): at com.rits.cloning.Cloner.deepClone(Cloner.java:323)

I think the problem is due to the following change in Android's libcore which changes the second parameter type of ObjectStreamClass.newInstance from int to long: https://android.googlesource.com/platform/libcore/+/a40dc9f768eb02dcfd7b1a659333757b148f7bec%5E%21/.





Henri Tremblay

unread,
Oct 6, 2013, 7:45:31 AM10/6/13
to objene...@googlegroups.com
My answer was extremely slow (because the issue was already existing) but indeed.

It is now fixed and should be delivered soon.







--
 
---
You received this message because you are subscribed to the Google Groups "Objenesis developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objenesis-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

cicero...@gmail.com

unread,
Jul 23, 2015, 1:12:05 PM7/23/15
to Objenesis developers, smich...@gmail.com
Did you solve this problem?

I  have the same exception

Henri Tremblay

unread,
Jul 23, 2015, 11:59:21 PM7/23/15
to objene...@googlegroups.com, smich...@gmail.com
Objenesis 1.3 is quite old. I'm not sure Objenesis was supported 4.3 at that time

Can you try with 2.1 please? I just tried Objenesis 2.2-SNAPSHOT on Android 4.3.1 with success.

--

---
You received this message because you are subscribed to the Google Groups "Objenesis developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to objenesis-de...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Cícero Moura

unread,
Jul 24, 2015, 8:36:41 AM7/24/15
to objene...@googlegroups.com, smich...@gmail.com
Yes, I am using last version, 2.1, and solved my problem.
I saw that last version there are a treatment for the Android version.

 Thanks :)

Att,

Cícero Moura

--

---
You received this message because you are subscribed to a topic in the Google Groups "Objenesis developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/objenesis-dev/jdqWCwy5E78/unsubscribe.
To unsubscribe from this group and all its topics, send an email to objenesis-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages