Showcaseview的NoClassDefFoundError [英] Showcaseview NoClassDefFoundError

查看:173
本文介绍了Showcaseview的NoClassDefFoundError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加 showcaseview 罐子到我的项目,这样使用它

I added showcaseview jar into my project and use it like this

    ShowcaseView.ConfigOptions co = new ShowcaseView.ConfigOptions();
    co.hideOnClickOutside = true;

    ViewTarget target = new ViewTarget(R.id.button_start_game, this);
    ShowcaseView sv = ShowcaseView.insertShowcaseView(target, this, R.string.showcase_main_title, R.string.showcase_main_message, co);
    sv.setOnShowcaseEventListener(this);

但我有例外

02-05 20:03:25.495: E/AndroidRuntime(25767): FATAL EXCEPTION: main
02-05 20:03:25.495: E/AndroidRuntime(25767): Process: com...., PID: 25767
02-05 20:03:25.495: E/AndroidRuntime(25767): java.lang.NoClassDefFoundError: com.github.espiandev.showcaseview.R$styleable
02-05 20:03:25.495: E/AndroidRuntime(25767):    at com.espian.showcaseview.ShowcaseView.<init>(ShowcaseView.java:105)
02-05 20:03:25.495: E/AndroidRuntime(25767):    at com.espian.showcaseview.ShowcaseView.<init>(ShowcaseView.java:97)
02-05 20:03:25.495: E/AndroidRuntime(25767):    at com.espian.showcaseview.ShowcaseView.insertShowcaseViewInternal(ShowcaseView.java:825)
02-05 20:03:25.495: E/AndroidRuntime(25767):    at com.espian.showcaseview.ShowcaseView.insertShowcaseView(ShowcaseView.java:854)
02-05 20:03:25.495: E/AndroidRuntime(25767):    at com...MainActivity.onCreate(MainActivity.java:82)

82行有

ShowcaseView sv = ShowcaseView.insertShowcaseView(target, this, R.string.showcase_main_title, R.string.showcase_main_message, co);

这可能是什么问题?

What could be the problem?

推荐答案

我是一个菜鸟开发者,我似乎总是停留在这样的事情......

I'm a rookie Developer and I always seem to get stuck on things like this...

解决的办法是不使用的JAR,添加Showcaseview项目作为一个库,而不是。

The solution is to not use a JAR, add the Showcaseview project as a library instead.

我按下面的步骤解决了这个同样的问题:

I solved this same issue by the following steps:

  1. 导入主项目,该项目是在库文件夹到从我的工作区 https://github.com/amlcurran/ShowcaseView

  1. Import "Main" project that is in the "library" folder into my workspace from https://github.com/amlcurran/ShowcaseView

右键单击第1步导入的项目,然后单击属性> Android和检查是库框 ![在此输入图片说明] [2]

Right click the imported project from Step 1 and click properties>Android and check the "is library" box ![enter image description here][2]

享受更少的波浪红线!

我会后的屏幕截图,但这是我第一次发布的SO ...

I would post screen shots but this is my first SO post...

这篇关于Showcaseview的NoClassDefFoundError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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