Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to proprerly include Showcase View lib

I have trouble including the ShowcaseView library in my Android application with Android Studio.

On the GitHub repo (https://github.com/Espiandev/ShowcaseView), it says it should be easy to install with Maven. But when I search for showcaseview, Maven finds no result.

So I clone the repo on my computer and try to include it's library folder as a java library in my project's module dependencies. But when I try to use it in my code, it says

Cannot resolve symbol 'ShowcaseView'

My guess is because the actual ShowcaseView library is not compiling due to errors (the cloned repo is showing in multiple files the error

Cannot resolve symbol 'R'

event after adding the NineOldAndroids as a module dependency as showed on the GitHub repo.

Is there something I am missing?

like image 505
Raphael Royer-Rivard Avatar asked Nov 01 '13 17:11

Raphael Royer-Rivard


1 Answers

You shouldn't include library folder as a java library.

try following way to add ShowcaseView library as a module to your project:

Go to file > Project Structure...

in the left panel select Modules and in the middle panel click plus icon and then select Import Module from browsing dialog select path of ShowcaseView library

click next... to finish importing (but notice the directory /gen of library unchecked)

Then goto the Library section in left panel and select libs in middle panel

if the library robolectric-2.2-20130909.210745-40-jar-with-dependencies.jar existed in right panel then you should remove it.

Goto the Modules section and select your main project module in middle panel and click plus icon in right panel and select Module Dependency... then select ShowcaseView library that previously included.

Now you should rebuild your project...

like image 137
Mohammad Reza Norouzi Avatar answered Nov 09 '22 10:11

Mohammad Reza Norouzi