Smack on android errors

I was trying out the smack 3.0.4 API for connecting to gtalk using Android SDK 1.0 .

I was able to connect but had two errors.

Any ideas on resolving this error? or is Smack supporting Android?

First error is something regarding Keystore as shown below:

------------------error 1 ---------------------

10-18 08:40:10.884: WARN/System.err(266):

java.security.KeyStoreException: KeyStore jks implementation not found

10-18 08:40:10.884: WARN/System.err(266): at

java.security.KeyStore.getInstance(KeyStore.java:107)

10-18 08:40:10.894: WARN/System.err(266): at

org.jivesoftware.smack.ServerTrustManager.(ServerTrustManager.java:

10-18 08:40:10.894: WARN/System.err(266): at

org.jivesoftware.smack.XMPPConnection.proceedTLSReceived(XMPPConnection.jav a:

10-18 08:40:10.904: WARN/System.err(266): at

org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:

10-18 08:40:10.904: WARN/System.err(266): at

org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

10-18 08:40:10.904: WARN/System.err(266): at

org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

------------end err 1 --------------------------

Second error was after I got the connection and I was able to send a

message but threw the below exception:

-----------error 2-------------------------------------

10-18 08:40:14.814: WARN/dalvikvm(266): VFY: unable to resolve new-

instance 201 (Ljava/beans/PropertyDescriptor;) in Lorg/jivesoftware/

smack/util/PacketParserUtils;

10-18 08:40:14.834: WARN/dalvikvm(266): VFY: rejecting opcode 0x22 at

0x0016

10-18 08:40:14.834: WARN/dalvikvm(266): VFY: rejected Lorg/

jivesoftware/smack/util/PacketParserUtils;.parseWithIntrospection

(Ljava/lang/String;Ljava/lang/Class;Lorg/xmlpull/v1/

XmlPullParser;)Ljava/lang/Object;

10-18 08:40:14.834: WARN/dalvikvm(266): Verifier rejected class Lorg/

jivesoftware/smack/util/PacketParserUtils;

10-18 08:40:14.854: WARN/dalvikvm(266): threadid=23: thread exiting

with uncaught exception (group=0x40010e28)

10-18 08:40:14.854: ERROR/AndroidRuntime(266): Uncaught handler:

thread Smack Packet Reader (0) exiting due to uncaught exception

10-18 08:40:14.864: ERROR/AndroidRuntime(266): java.lang.VerifyError:

org.jivesoftware.smack.util.PacketParserUtils

10-18 08:40:14.864: ERROR/AndroidRuntime(266): at

org.jivesoftware.smack.PacketReader.parsePackets(PacketReader.java:

10-18 08:40:14.864: ERROR/AndroidRuntime(266): at

org.jivesoftware.smack.PacketReader.access$000(PacketReader.java:44)

10-18 08:40:14.864: ERROR/AndroidRuntime(266): at

org.jivesoftware.smack.PacketReader$1.run(PacketReader.java:76)

--------- end err 2 -----------------------------------------

I also have these errors plus I’m getting crash on PacketReader.java on line #278:

processPacket(PacketParserUtils.parsePresence(

parser));

after I perform XMPPConnection.login

Help, please!

This errors are exactly what I have. Did you guys find any solution to it? After researching for couple of days, I think it has something to do with Security features of either JDK or Android.

Please let me know if you did found a workaround.

Thanks.

Yes, you need to use the android version smack.jar which has been changed to target to android platform.

Here is the jar file.

Thanks,

Qiuzhuang
smack.jar (728691 Bytes)

hi,

tried this version of smack on g1 and it work fine!

but one question… where i can get the sources of this version to see which changes were made to get it working

i’m currently working on an android application using smack, but i have to make some further adjustmenst for my purposes …

thanks

Where is the source for this Android version of Smack maintained, so that I know I have the most up-to-date version?

I’ve patched my own trunk-based smack…

See http://github.com/rtreffer/asmack if you are interrested.

Your version is missing a patch to remove the dependencies on java bean properties. 3.1(.X) won’t work on android without this.

Another important peace is the SASL implementation and the DNSUtil replacement.

The keystore error is completely irrelevant.

Regards,

Rene

This version works fine for login, messages, etc - thanks.

however, it doesn’t support file transfer. attempting to transfer a file results in a crash in the FileTransferNegotiator.

any ideas?

why not just use asmack.jar !? As far as I understand it has been developed especially for the android platform…

regards

This is what I’m doing - asmack is a “port” of the smack library to android - all it did was to disable some features that require APIs that are not available on android (authentication). they didn’t bother to re-implement them using Android APIs (and I didn’t care either…)

My problem is that the file transfer of smack doesn’t work on asmack. I tried a long time to make it work, and eventually, implemented my own “file transfer protocol” using Smack’s proprietary feature of “message properties”.

Not sure how you came to that conclusion, but authentification is reimplemented using various sasl bits from around the web. It’s about the only apache licensed sasl replacement you’ll be able to get.

Anyway, it might help to post your problems to the bugtracker, instead of being silent and ranting here.

Filetrasnfer is part of smackx, which should be shipped out-of-the-box. All you have to do is initializing the extensions and register the packet extensions. I’d bet you didn’t register the packet extensions on your own, did you? Is your code open source so I can step through it?

Regards,

Rene

Message was edited by: treffer