androidgradleandroid-studioandroid-libraryshowcaseview

importing ShowcaseView with gradle


I'm trying to use the ShowcaseView project in my app but can't get the project to build.

when I run 'gradle clean installDebug' I get the following error:

A problem occurred evaluating root project 'hows-it-going'.

Could not find method compile() for arguments [project ':ShowcaseView'] on root project 'hows-it-going'.

I'm using gradle 1.11 and Android Studio 0.54.

I've downloaded the source, and imported the project using file -> Import module -> ShowcaseView
which makes my project structure like:

-project
--app
--ShowcaseView

my settings.gradle file looks like:

include ':app', 'ShowcaseView'


and in my project level build.gradle I have the following:

dependencies {
  compile project (':ShowcaseView')
}

Any help with how to include this properly would be much appreciated. Thanks.


Solution

  • I recently just added ShowcaseView to an Android Studio project, and I hope this can push you in the correct direction.

    My file structure looks something like this:


    1. Add the files from the library folder of ShowcaseView to the showcase directory in the libraries directory.

    2. Add the showcase directory as a module to your project.

    3. Change your app's build.gradle file to include:

      dependencies {
        compile project(':libraries:showcase')
      }
      
    4. Change your settings.gradle to include:

      include ':libraries:showcase'

    5. Sync Project with gradle files

    This StackOverflow answer goes over how to do this is much more detail if you have any troubles, but this method works for any library.