IllegalArgumentException on message receipt

99 views
Skip to first unread message

mmayorga

unread,
Aug 4, 2010, 7:22:30 PM8/4/10
to android-c2dm
Hello, I'm able to send notifications to C2DM without issues, but
having issues receiving these on the device, erroring out with the
exception below. I'd appreciate any pointers. Thanks!


D/SQLiteQueryBuilder( 187): Performing query: SELECT username, otr
FROM contacts WHERE (account=? AND username=?)
E/TalkProvider( 187): query db caught
E/TalkProvider( 187): java.lang.IllegalArgumentException: the bind
value at index 2 is null
E/TalkProvider( 187): at
android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:
234)
E/TalkProvider( 187): at
android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:182)
E/TalkProvider( 187): at
android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:
48)
E/TalkProvider( 187): at
android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:
1345)
E/TalkProvider( 187): at
android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:
330)
E/TalkProvider( 187): at
com.google.android.gsf.talk.TalkProvider.queryInternal(TalkProvider.java:
1740)
E/TalkProvider( 187): at
com.google.android.gsf.talk.TalkProvider.query(TalkProvider.java:1436)
E/TalkProvider( 187): at android.content.ContentProvider
$Transport.query(ContentProvider.java:163)
E/TalkProvider( 187): at
android.content.ContentResolver.query(ContentResolver.java:245)
E/TalkProvider( 187): at
com.google.android.gsf.gtalkservice.DatabaseHelper.getOffTheRecordCursor(DatabaseHelper.java:
756)
E/TalkProvider( 187): at
com.google.android.gsf.gtalkservice.ChatSession.queryOtrCursor(ChatSession.java:
206)
E/TalkProvider( 187): at
com.google.android.gsf.gtalkservice.ChatSession.<init>(ChatSession.java:
168)
E/TalkProvider( 187): at
com.google.android.gsf.gtalkservice.ChatMgr.createChatSession(ChatMgr.java:
264)
E/TalkProvider( 187): at
com.google.android.gsf.gtalkservice.ChatMgr.processIncomingMessage(ChatMgr.java:
721)
E/TalkProvider( 187): at
com.google.android.gsf.gtalkservice.ChatMgr.processPacket(ChatMgr.java:
521)
E/TalkProvider( 187): at org.jivesoftware.smack.PacketReader
$ListenerWrapper.notifyListener(PacketReader.java:1860)
E/TalkProvider( 187): at
org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:
451)
E/TalkProvider( 187): at org.jivesoftware.smack.PacketReader.access
$200(PacketReader.java:91)
E/TalkProvider( 187): at org.jivesoftware.smack.PacketReader
$3.run(PacketReader.java:154)


Jasmin

unread,
Aug 8, 2010, 1:37:50 PM8/8/10
to android-c2dm
Looks like a DB exception to me... You're either not binding a
username to the query or the object you're binding is null.

On Aug 4, 7:22 pm, mmayorga <dgluho...@gmail.com> wrote:
> Hello, I'm able to send notifications to C2DM without issues, but
> having issues receiving these on the device, erroring out with the
> exception below.  I'd appreciate any pointers.  Thanks!
>
> D/SQLiteQueryBuilder(  187): Performing query: SELECT username, otr
> FROM contacts WHERE (account=? AND username=?)
> E/TalkProvider(  187): query db caught
> E/TalkProvider(  187): java.lang.IllegalArgumentException: the bind
> value at index 2 is null
> E/TalkProvider(  187):  at
> android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:
> 234)
> E/TalkProvider(  187):  at
> android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:182)
> E/TalkProvider(  187):  at
> android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDr­iver.java:
> 48)
> E/TalkProvider(  187):  at
> android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.j­ava:
> 1345)
> E/TalkProvider(  187):  at
> android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:
> 330)
> E/TalkProvider(  187):  at
> com.google.android.gsf.talk.TalkProvider.queryInternal(TalkProvider.java:
> 1740)
> E/TalkProvider(  187):  at
> com.google.android.gsf.talk.TalkProvider.query(TalkProvider.java:1436)
> E/TalkProvider(  187):  at android.content.ContentProvider
> $Transport.query(ContentProvider.java:163)
> E/TalkProvider(  187):  at
> android.content.ContentResolver.query(ContentResolver.java:245)
> E/TalkProvider(  187):  at
> com.google.android.gsf.gtalkservice.DatabaseHelper.getOffTheRecordCursor(Da­tabaseHelper.java:
> 756)
> E/TalkProvider(  187):  at
> com.google.android.gsf.gtalkservice.ChatSession.queryOtrCursor(ChatSession.­java:
> 206)
> E/TalkProvider(  187):  at
> com.google.android.gsf.gtalkservice.ChatSession.<init>(ChatSession.java:
> 168)
> E/TalkProvider(  187):  at
> com.google.android.gsf.gtalkservice.ChatMgr.createChatSession(ChatMgr.java:
> 264)
> E/TalkProvider(  187):  at
> com.google.android.gsf.gtalkservice.ChatMgr.processIncomingMessage(ChatMgr.­java:

mmayorga

unread,
Aug 9, 2010, 4:02:27 PM8/9/10
to android-c2dm
Thanks Jasmin. This XMPP handler codepath is really a blackbox for me
(especially the GtalkService part), I'm only trying to push
notifications.

Looks like one problem was that my sender and (test) receiver accounts
were the same (in particular, sender not in receiver's contact list).
It successfully initiates a chat session if different accounts are
used, though I still haven't tried a recipient account that doesn't
have the sender in Contacts, not sure if required.
Message has been deleted
Message has been deleted

Elias Mårtenson

unread,
Aug 17, 2010, 9:08:02 PM8/17/10
to android-c2dm
On Aug 10, 4:02 am, mmayorga <dgluho...@gmail.com> wrote:

> Looks like one problem was that my sender and (test) receiver accounts
> were the same (in particular, sender not in receiver's contact list).
> It successfully initiates a chat session if different accounts are
> used, though I still haven't tried a recipient account that doesn't
> have the sender in Contacts, not sure if required.

I just faced the same problem. I only get the exception on my Nexus 1,
which could very well be explained by the fact that I'm using a
different Google ID on the emulator.

fidojones

unread,
Aug 18, 2010, 8:22:19 AM8/18/10
to android-c2dm
Same problem:

E/TalkProvider( 3298): query db caught
E/TalkProvider( 3298): java.lang.IllegalArgumentException: the bind
value at index 2 is null
E/TalkProvider( 3298): at
android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:
234)
E/TalkProvider( 3298): at
android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:182)
E/TalkProvider( 3298): at
android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:
48)
E/TalkProvider( 3298): at
android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:
1345)
E/TalkProvider( 3298): at
android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:
330)
E/TalkProvider( 3298): at
com.google.android.gsf.talk.TalkProvider.queryInternal(TalkProvider.java:
1740)

Matthew

unread,
Aug 29, 2010, 2:18:04 PM8/29/10
to android-c2dm
I just finishing implementing a first pass at c2dm, and I am also
getting this very same exception. I cannot find much information about
this online. I'm using the Motorola Droid, running 2.2. I'm getting a
200 OK from the Google server, and then a few seconds later the phone
throws that exception and Talk on the phone drops the connection (you
can see the Talk UI behave like it just dropped a connection).

I am baffled as to what I am doing wrong. Chrome To Phone works fine
for me. I'm also comparing the Chrome To Phone code against mine, the
manifest, etc. and I am at a loss. Has anyone who posted here gotten
past this issue? Thanks

Matthew

unread,
Aug 29, 2010, 3:20:24 PM8/29/10
to android-c2dm
Following up to my previous post, my c2dm account is the same GMail
account as my phone is configured for, which several people on this
mailing list said as well (and had this problem). I set up a second
Google account, added it to my phone, registered my app, pushed the
reg id to my server, sent a successful message (got the ID back)
through c2dm, and the phone still threw the very same exception. So,
either way, with the same Google account or separate, I still get the
IllegalArgumentException for the Talk application. Chrome to Phone
still works fine.

Matthew

unread,
Aug 29, 2010, 6:27:56 PM8/29/10
to android-c2dm
Ok, I have been able to isolate the IllegalArgumentException on c2dm
message receive issue. If you are currently signed into Google Talk on
your Android 2.2, then for some reason it crashes there and Google
Talk gets bounced. I went into Talk and turned off auto-sign in, then
I signed out. I tested again and I was able to receive the message
inside my application. There is some issue with Google Talk and c2dm
right now. The workaround is to keep Talk signed out on your phone.

Model: Droid
Android Version: 2.2
Kernel Version: 2.6.32.9-g103d848 android-build@apa26 #1
Build Number: FRG01B
Carrier: Verizon

Aaron

unread,
Sep 29, 2010, 4:37:44 PM9/29/10
to android-c2dm
Thank you Matthew awesome trouble shooting!

I have been banging my head on this for about 2 days now. Once I
signed out of Google Talk everything started working perfectly!

This is happening on 2.2.1 Nexus as well, does anyone know if there is
a long term fix out there?

Model: Nexus
Android Version: 2.2.1
Kernel Version: 2.6.32.9-27240-gbca5320 android-build@apa26#1
Build Number:FRG83
Carrier: TMobile

-Aaron

Matthew Jones

unread,
Sep 30, 2010, 5:09:19 PM9/30/10
to androi...@googlegroups.com
I'm glad that several people have been able to see this issue, and at least you have taken my workaround and confirmed it makes the problem go away. I'm just waiting on someone at Google to hear this message and let us know what the true underlying issue is and when it is going to get resolved. This is the _only_ issue that is preventing me from launching an upgraded version of my application on the Market.

Roman Nurik

unread,
Sep 30, 2010, 5:36:40 PM9/30/10
to androi...@googlegroups.com
Hi Matthew, all,

By chance is the sender ID the same as the primary Google account on the device? There are known issues with that at the moment.

Roman

Matthew Jones

unread,
Sep 30, 2010, 5:40:51 PM9/30/10
to androi...@googlegroups.com
Actually, in my case it is. I tried using a secondary Google account when my app was registering with my service, but I suppose the primary account on the phone is still the same one as the sender. I did not think of it that way. I do recall hearing some issues about that. I guess at this point I can try to change my sender address with c2dm. Who should I contact about changing it? Once changed, I can re-test and then let the mailing list know if that made the problem go away for me.

- Matt

Roman Nurik

unread,
Sep 30, 2010, 5:43:36 PM9/30/10
to androi...@googlegroups.com
Easiest thing is to just sign up again with a new sender ID. Entry into the preview is automatic now.

Roman
Reply all
Reply to author
Forward
0 new messages