All of the answers in similar questions talk about manunally editting gradle files. But I've used Android Studio to import the AAR file and checked the build.gradle files and they all seem correct.
My problem is this:
I've imported ShowCaseView v5.0.0 AAR but when I try to import the classes in my Tutorial.java file (you can see in red) Android Studio doesn't recognise the classes. The only import that Android Studio recognises is com.github.amlcurran.showcaseview.R
.
I've also tried to clean & rebuild the project, and close & reopen Android Studio but it doesn't help.
P.S. please ignore the missing XML files as that was before I copied them into the project.
Gradle files
ShowCaseView-5.0.0 > build.gradle:
configurations.create("default")
artifacts.add("default", file('ShowCaseView-5.0.0.aar'))
My app's build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.giraffeweather"
minSdkVersion 19
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile project(':ShowCaseView-5.0.0')
}
The Android Studio project's build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
The gradle settings file settings.gradle:
include ':app', ':ShowCaseView-5.0.0'