2

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.

Daniel Jonker
  • 844
  • 10
  • 21

5 Answers5

5

The latest version of ShowcaseView is available as a .AAR dependency. To use it, add:

repositories {
    mavenCentral()
    maven {
        url 'https://oss.sonatype.org/content/repositories/snapshots'
    }
}

To your build.gradle file and, under the dependencies block, add:

compile 'com.github.amlcurran.showcaseview:library:5.0.0-SNAPSHOT'

I'll get a stable, non-snapshot, version out soon.

Alex Curran
  • 8,818
  • 6
  • 49
  • 55
  • This answer is better than mine, would use the new .AAR dependency over importing the files manually. – Andrew Gable Jun 03 '14 at 15:23
  • 3
    Hi, thanks for maven repo but it seems it doesn't work for me. Maybe different Gradle version? I'm using the latest one - 0.11 and it gives me error: Artifact 'com....library.jar' not found. The repositories block is in the same file as compile command - in app/build.gradle – JerabekJakub Jun 13 '14 at 10:46
5

It should actually be

compile 'com.github.amlcurran.showcaseview:library:5.0.0-SNAPSHOT@aar'

That way Maven will use .AAR file

Yasha
  • 1,017
  • 11
  • 21
4

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:

  • project
    • app
      • build.gradle
    • libraries
      • showcase
    • build.gradle
    • settings.gradle

  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.

Community
  • 1
  • 1
Andrew Gable
  • 2,692
  • 2
  • 24
  • 36
0

The compile dependency on ShowcaseView should likely be defined in app/build.gradle, not in the root project's build.gradle. Unless a project explicitly (configurations block) or implicitly (by applying a plugin such as java) defines a compile configuration, it won't have one, and an attempt to add a compile dependency will result in the error you mentioned.

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259
0

I added this in build.gradle and it worked

compile 'com.github.amlcurran.showcaseview:library:5.4.3'
Richa
  • 700
  • 8
  • 12