2

I'm developing my firsrt glassware. Everything works fine but sharing timeline item causes glass to crash. When I select share option from actions, Glass asks me to select contacts. When I choose the contact, it shows Sharing progress then shows Shared message and about a second later, Glass stops unexpectedly and Glass Home starts again. I won't get notification to my callback url and timeline item duplicated in my timeline with only delete action available. I checked the logs of Glass and get the following exception:

09-16 18:45:57.986  18588-18638/? W/dalvikvm: threadid=28: thread exiting with uncaught exception (group=0x40db11f8)
09-16 18:45:57.994  18588-18638/? E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #12
        java.lang.IllegalStateException: Expected condition to be true.
        at com.google.glass.predicates.Assert.assertTrue(Assert.java:82)
        at com.google.glass.share.ShareTimelineItemJob$4.onExecute(ShareTimelineItemJob.java:305)
        at com.google.glass.timeline.TimelineHelper$Update.execute(TimelineHelper.java:279)
        at com.google.glass.timeline.TimelineHelper.atomicUpdateTimelineItem(TimelineHelper.java:638)
        at com.google.glass.share.ShareTimelineItemJob.updateToFinalShareItem(ShareTimelineItemJob.java:349)
        at com.google.glass.share.ShareTimelineItemJob.run(ShareTimelineItemJob.java:154)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
        at java.lang.Thread.run(Thread.java:856)
09-16 18:45:58.033     189-3487/? W/ActivityManager: Force finishing activity com.google.glass.home/.timeline.MainTimelineActivity
09-16 18:45:58.088  18588-18588/? I/ShareActivity: onPause: 428d7a80
09-16 18:45:58.119     697-1145/? W/VoiceEngine: Stopping reading from microphone because read < 0
09-16 18:45:58.119     697-1145/? W/VoiceEngine: Stopped reading from microphone
09-16 18:45:58.135      189-494/? I/ActivityManager: START {act=android.intent.action.MAIN cat=[android.intent.category.HOME] flg=0x10000000 cmp=com.google.glass.home/.timeline.MainTimelineActivity} from pid 0

I'm using Java example project. And this is the code that I inserted the timeline item

TimelineItem timelineItem = new TimelineItem();

List<MenuItem> menuItemList = new ArrayList<MenuItem>();
menuItemList.add(new MenuItem().setAction("SHARE"));
timelineItem.setMenuItems(menuItemList);

timelineItem.setText("Hello Glass");

// Triggers an audible tone when the timeline item is received
timelineItem.setNotification(new NotificationConfig().setLevel("DEFAULT"));

MirrorClient.insertTimelineItem(credential, timelineItem);

What am I doing wrong?

UPDATE: I tried following request from playground and it causes the exception as well

   {
  "kind": "mirror#timelineItem",
  "id": "1100196a-10b1-4ce4-9639-6e75b5a8c881",
  "created": "2013-09-17T09:25:29.818Z",
  "updated": "2013-09-17T09:25:29.818Z",
  "etag": "\"hzfI85yu0lKQdtWV4PO1jAbQxWw/Tth-2CVHTjXcdWQ64xW2tMt--sk\"",
  "text": "This item auto-resizes according to the text length",
  "menuItems": [
    {
      "action": "SHARE"
    }
  ],
  "notification": {
    "level": "DEFAULT"
  }
}
arikan
  • 35
  • 5
  • 1
    This is a strange one. Where is the Java code that's using the Mirror API running? Does the insertTimelineItem() function produce any exceptions or logging output? Can you insert timeline items from other sources, like the playground? – mimming Sep 16 '13 at 16:06
  • Hi Jenny, application runs on Tomcat7 application server. insertTimelineItem() doesn't produce any exception. TimelineItem inserted to timeline without error. Same exception occurs when I inserted timeline item from the playground. I updated question and added to sample request that causes the exception. I sent this – arikan Sep 17 '13 at 09:27
  • Hi @JennyMurphy, I still couldn't solve the problem.do you have any idea about it? – arikan Sep 19 '13 at 23:30
  • Im having the same issue. Any help here? – tokudu Oct 04 '13 at 22:19
  • That JSON worked great on the playground form me. It sounds like there may be an issue with your API key. Can you try switching to a new key with the Mirror API enabled? Does the issue persist? – mimming Oct 07 '13 at 18:34

1 Answers1

0

This was a bug in XE9. It was reported in issue #197 on the official issue tracker.

Per the release notes it was fixed in XE10.

mimming
  • 13,974
  • 3
  • 45
  • 74