Android Studio 1.2.2 ClassNotFoundException android.widget.viewstub [英] Android Studio 1.2.2 ClassNotFoundException android.widget.viewstub

查看:18
本文介绍了Android Studio 1.2.2 ClassNotFoundException android.widget.viewstub的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚安装了 Android Studio,每当我开始一个项目时(甚至是由 IDE 创建的默认Hello world"活动).

I just installed Android Studio and whenever I start a project (even the default "Hello world" activity created by the IDE).

我有这个异常:

java.lang.ClassNotFoundException: 没有找到类路径上的android.widget.ViewStub":DexPathList[[zip 文件"/data/app/com.example.noname.exceptiontest-2/base.apk"],nativeLibraryDirectories=[/vendor/lib/system/lib]]

java.lang.ClassNotFoundException: Didn't find class "android.widget.ViewStub" on path: DexPathList[[zip file "/data/app/com.example.noname.exceptiontest-2/base.apk"],nativeLibraryDirectories=[/vendor/lib /system/lib]]

我希望我有一些 logcat 来显示,但它似乎没有记录这个异常.

I wished I had some logcat to show but it doesn't seems like this exception is logged in it.

它不会停止我的项目或任何其他项目的工作,只是每次我在调试中运行我的项目时都要通过这个异常的堆栈有点令人沮丧.

It doesn't stop the project or any other project that I have from working, just a little bit frustrating to go through the stack of this exception every time I run my projects in debug.

在网上查了一下,这个问题似乎不是很多人,只有符合我的问题的答案才会是Android studio的问题.然而,这些答案的历史已经超过一年.

After looking around the Internet it doesn't seem that that many people have this problem, only answer that would match my issue would be a problem with Android studio. However those answers dated from more than one year.

我刚换了电脑,想从 Eclipse 转移到 Android Studio,利用空闲时间做一些开发.我暂时无法访问我以前的环境来尝试安装 Android Studio 并重现该错误.

I just changed my computer and wanted to move from Eclipse to Android Studio to do some development on my free time. I don't have access to my previous environment for the moment to try to install Android studio and reproduce that error.

有没有人遇到或已经遇到过这个错误?(要重现 New Hello world Activity,请在 Android Studio 中激活任何异常并在调试中运行)

Does anyone have or already had this error ? (To reproduce New Hello world Activity, activate any exception in Android Studio and run in debug)

干杯

推荐答案

如果出现这个异常是因为设置了异常断点,那么不要调试,去掉所有断点,直接运行代码,去logcat检查一下记录实际异常.您可能试图从祖父母访问一个嵌套组件,如按钮,因此出现错误.

If you are getting this exception because you have set exception breakpoint, then instead of debugging, remove all breakpoints, just run the code,go to logcat and check the logs for the actual exception. You could be trying to access a nested component like button from the grandparent and therefore the error.

这篇关于Android Studio 1.2.2 ClassNotFoundException android.widget.viewstub的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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