irmen / Pyrolite

Java and .NET client interface for Pyro5 protocol
MIT License
177 stars 47 forks source link

pyrolite and Android: VerifyError #6

Closed moyvera closed 10 years ago

moyvera commented 10 years ago

Hello bro, I think your project is very useful.

I was trying to do an interface with your library, I got no mistakes with only Java but when I tried on Android, fail =S.

I get this log:

03-05 22:19:05.039: E/AndroidRuntime(9558): java.lang.VerifyError: net/razorvine/pickle/Pickler

I hope you can help me.

Regards, best!

irmen commented 10 years ago

I don't have Android development experience. But are you using the jar as-is or are you compiling it with the Android SDK/compiler ? A quick google brings up this as well: http://stackoverflow.com/questions/668788/android-java-lang-verifyerror Maybe that provides some pointers for you to find out what exactly is causing the VerifyError. Please report back if it is something you can't solve on your end.

moyvera commented 10 years ago

Hello I already checked that link but nothing. I was reading a lot of information.

My last hypothesis is that Android doesn't have some libraries or incomplete of java, so I reviewed your imports and saw you are using java.beans.* but Android doesn't have all classes. So, I'm gonna use openbeans and I'll post my results.

moyvera commented 10 years ago

Well, this is going to be a problem, the libraries that you are based on also are based on Java.beans...

So, I think it is not a good way modifying all the classes...

irmen commented 10 years ago

Is it just the java.bean API that is not supported in Android? Then it is just the put_javabean method in the Pickler class that needs modification. So you could strip that out, or replace it with an implementation that uses the reflection api directly (which is a bit more work). Pull requests gladly accepted :-) (or wait until I have some time to spend on this...)

irmen commented 10 years ago

Right, I went ahead and replaced the code in pyrolite (and serpent.jar) that depended on the java.beans API. It now uses only raw reflection and should still produce the same result. Can you please confirm if the new code works on your Android device? It's available on the download location or just rebuild it after pulling my last commit 6c7f4c5f5ee15d17bcfd5a5a49285816528cfda4

moyvera commented 10 years ago

I have great news, sorry I could not answer before...

I have tested your last commit and now it works!, fantastic bro, thanks.

I'm gonna publish a tutorial, and I'll add the link in this conversation :)

Regards!

irmen commented 10 years ago

finished the tutorial yet? :smile:

moyvera commented 10 years ago

Hello bro, sorry I was so busy but here is the link

http://geekalt42.net/pyro-y-android-usando-pyrolite-8366

and the mini project is on GitHub in my profile bro

Regards!