Google Glass为glass.widget.CardBuilder返回NoClassDefFoundError [英] Google glass returning NoClassDefFoundError for glass.widget.CardBuilder

查看:96
本文介绍了Google Glass为glass.widget.CardBuilder返回NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Glass开发非常陌生,但是遇到了一个令人沮丧的问题,这完全停止了我的进步.

I'm very new to Glass development yet have run into a frustrating problem which has pretty well halted my progress entirely.

在构建并运行 any Glass项目时,出现以下错误:

Upon building and running any Glass project, I am greeted with the error:

java.lang.NoClassDefFoundError: com.google.android.glass.widget.CardBuilder

一旦访问CardBuilder类,就会发生此错误.我已经导入了该类,并且在构建过程中没有出现错误,这是代码实际上在设备上运行时发生的问题.

This error occurs as soon as the CardBuilder class is accessed. I have imported the class and no errors appear during building, it is when the code is actually ran on the device that the issue occurs.

现在有趣的是,即使使用Google自己的GDK示例项目,也不仅仅是我自己编写的项目,都会发生此错误.唯一不会发生的情况是使用Stopwatch示例项目时,我相信这是因为Stopwatch没有实现CardBuilder类.我已经在Linux,OS X和Windows计算机上的多个Android Studio安装上对其进行了测试.在这一点上,我相信Glass本身可能存在配置问题,或者Android Studio可能存在一个非常奇怪的错误.

Now interestingly, this error occurs even when using Google's own GDK example projects, not just projects I've coded myself. The only time it doesn't occur is when using the Stopwatch example project, I believe this to be because the Stopwatch doesn't implement the CardBuilder class. I have tested it on multiple installs of Android Studio on both Linux, OS X, and Windows machines. At this point, I believe that perhaps there is a configuration problem on the Glass itself, or perhaps a very strange bug with the Android Studio.

有人曾经遇到过这个问题并成功解决吗?

Has anyone run into this problem before and successfully fixed it?

推荐答案

CardBuilder api在XE 21及其对应的GDK之后可用.

The CardBuilder api is available after XE 21 and its corresponding GDK.

您需要更新GLASS和GDK或使用旧的Card API.

You need to update your GLASS and GDK or otherwise use the old Card api.

Google的GDK示例假定您具有新的GDK和XE21.

Google's GDK examples assume you have the new GDK and XE21.

请参阅 Google Glass GDK向后兼容?.

此外, https://developers.google.com/glass/release-notes

XE21.0-2014年9月8日

XE21.0 - September 8, 2014

GDK

使用CardBuilder替换了Card,它支持更多布局.卡现已弃用,并将在以后的版本中删除.

Replaced Card with CardBuilder, which supports many more layouts. Card is now deprecated and will be removed in a future release.

这篇关于Google Glass为glass.widget.CardBuilder返回NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆