読者です 読者をやめる 読者になる 読者になる

isseium's blog

田舎に住むWebエンジニアのブログ

C2DMの実験(失敗)

C2DMを実機で試そうとしたら、次のエラーが発生して先に進めない...

12-02 23:59:07.436: ERROR/TalkProvider(315): query db caught 
12-02 23:59:07.436: ERROR/TalkProvider(315): java.lang.IllegalArgumentException: the bind value at index 2 is null
12-02 23:59:07.436: ERROR/TalkProvider(315):     at android.database.sqlite.SQLiteProgram.bindString(SQLiteProgram.java:234)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at android.database.sqlite.SQLiteQuery.bindString(SQLiteQuery.java:182)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at android.database.sqlite.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:48)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at android.database.sqlite.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:1345)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:330)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.talk.TalkProvider.queryInternal(TalkProvider.java:1740)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.talk.TalkProvider.query(TalkProvider.java:1436)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at android.content.ContentProvider$Transport.query(ContentProvider.java:186)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at android.content.ContentResolver.query(ContentResolver.java:245)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.gtalkservice.DatabaseHelper.getOffTheRecordCursor(DatabaseHelper.java:756)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.gtalkservice.ChatSession.queryOtrCursor(ChatSession.java:206)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.gtalkservice.ChatSession.<init>(ChatSession.java:168)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.gtalkservice.ChatMgr.createChatSession(ChatMgr.java:264)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.gtalkservice.ChatMgr.processIncomingMessage(ChatMgr.java:721)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at com.google.android.gsf.gtalkservice.ChatMgr.processPacket(ChatMgr.java:521)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader.java:1860)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:451)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at org.jivesoftware.smack.PacketReader.access$200(PacketReader.java:91)
12-02 23:59:07.436: ERROR/TalkProvider(315):     at org.jivesoftware.smack.PacketReader$3.run(PacketReader.java:154)
12-02 23:59:07.436: ERROR/Smack/Packet(315): [PacketReader] listenerThread: caught exception
12-02 23:59:07.443: ERROR/Smack/Packet(315): notify conn error. close connection!
12-02 23:59:07.443: ERROR/Smack/Packet(315): java.lang.NullPointerException
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at com.google.android.gsf.gtalkservice.ChatSession.queryOtrCursor(ChatSession.java:208)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at com.google.android.gsf.gtalkservice.ChatSession.<init>(ChatSession.java:168)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at com.google.android.gsf.gtalkservice.ChatMgr.createChatSession(ChatMgr.java:264)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at com.google.android.gsf.gtalkservice.ChatMgr.processIncomingMessage(ChatMgr.java:721)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at com.google.android.gsf.gtalkservice.ChatMgr.processPacket(ChatMgr.java:521)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at org.jivesoftware.smack.PacketReader$ListenerWrapper.notifyListener(PacketReader.java:1860)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at org.jivesoftware.smack.PacketReader.processListeners(PacketReader.java:451)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at org.jivesoftware.smack.PacketReader.access$200(PacketReader.java:91)
12-02 23:59:07.443: ERROR/Smack/Packet(315):     at org.jivesoftware.smack.PacketReader$3.run(PacketReader.java:154)


追記(2011/04/30)
C2DMで訳の分からないエラーで苦戦した - ミッションたぶんPossible

C2DM登録に使ったアカウントとAndroidにそれぞれ登録してあるアカウントが同じの場合には、クライアントでC2DMからのメッセージを受け取った際にエラーが起こってしまうようです

Android開発時には違うアカウントで!