user1825546
user1825546

Reputation: 53

Android Showcaseview library java.lang.NoClassDefFoundError

when i compile my app

i have this error..

how can i fix it?

01-26 23:27:33.392: E/AndroidRuntime(18895): java.lang.NoClassDefFoundError: com.espian.showcaseview.ShowcaseView$ConfigOptions

my code

ShowcaseView sv;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ShowcaseView.ConfigOptions co = new ShowcaseView.ConfigOptions();
    co.hideOnClickOutside = true;
    ViewTarget target = new ViewTarget(R.id.test, this);
    sv = ShowcaseView.insertShowcaseView(target, this, R.string.showcase_main_title, R.string.showcase_main_message, co);
    sv.setOnShowcaseEventListener(this);
}

@Override
public void onShowcaseViewHide(ShowcaseView showcaseView) {
    // TODO Auto-generated method stub

}

@Override
public void onShowcaseViewDidHide(ShowcaseView showcaseView) {
    // TODO Auto-generated method stub

}

@Override
public void onShowcaseViewShow(ShowcaseView showcaseView) {
    // TODO Auto-generated method stub

}

Upvotes: 0

Views: 501

Answers (1)

Luc
Luc

Reputation: 2805

Please ensure that your ShowCaseView class has static class ConfigOptions

public static class ConfigOptions {

    public boolean block = true, noButton = false;
    public boolean hideOnClickOutside = false;

    /**
     * Does not work with the {@link ShowcaseViews} class as it does not make sense (only with
     * {@link ShowcaseView}).
     * @deprecated not compatible with Target API
     */
    @Deprecated
    public int insert = INSERT_TO_DECOR;

    /**
     * If you want to use more than one Showcase with the {@link ConfigOptions#shotType} {@link
     * ShowcaseView#TYPE_ONE_SHOT} in one Activity, set a unique value for every different
     * Showcase you want to use.
     */
    public int showcaseId = 0;

    /**
     * If you want to use more than one Showcase with {@link ShowcaseView#TYPE_ONE_SHOT} in one
     * Activity, set a unique {@link ConfigOptions#showcaseId} value for every different
     * Showcase you want to use. If you want to use this in the {@link ShowcaseViews} class, you
     * need to set a custom showcaseId for each {@link ShowcaseView}.
     */
    public int shotType = TYPE_NO_LIMIT;

    /**
     * Default duration for fade in animation. Set to 0 to disable.
     */
    public int fadeInDuration = AnimationUtils.DEFAULT_DURATION;

    /**
     * Default duration for fade out animation. Set to 0 to disable.
     */
    public int fadeOutDuration = AnimationUtils.DEFAULT_DURATION;
    /**
     * Allow custom positioning of the button within the showcase view.
     */
    public LayoutParams buttonLayoutParams = null;

    /**
     * Whether the text should be centered or stretched in the available space
     */
    public boolean centerText = false;
}

Upvotes: 1

Related Questions