I'm having massive trouble trying to get my app project to build. I have the main app module and a library project module as shown below:
This is the gradle.build for each of the modules:
Main App:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion '19.0.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
}
buildTypes {
release {
runProguard true
proguardFile getDefaultProguardFile('proguard-android-optimize.txt')
}
}
productFlavors {
defaultFlavor {
proguardFile 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v13:19.0.+'
compile 'com.google.android.gms:play-services:4.0.+'
compile project(':libraries:datetimepicker')
}
And this one is for the library Project:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.6.+'
}
}
apply plugin: 'android-library'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
}
release {
runProguard true
proguardFile 'proguard-rules.txt'
proguardFile getDefaultProguardFile('proguard-android-ptimize.txt')
}
}
dependencies {
compile 'com.android.support:support-v4:19.0.+'
}
Finally, This is the project settings.gradle file.
include ':App', ':libraries:datetimepicker'
I am able to successfully import packages from the library to my App code and use them, however when I try to compile I get the following:
Gradle: Execution failed for task ':App:compileDefaultFlavorDebug'.
> Compilation failed; see the compiler error output for details.
E:lahlahMyClass.java
Gradle: error: cannot find symbol class DatePickerDialog
Gradle: error: package DatePickerDialog does not exist
Gradle: error: cannot find symbol class DatePickerDialog
Gradle: error: cannot find symbol class DatePickerDialog
Gradle: error: cannot find symbol variable DatePickerDialog
Gradle: error: method does not override or implement a method from a supertype
I've been trying to fix this for 3 days now and have exhausted almost all of the similar question solutions I could find on here. I'm pretty confident with developing for android, not so confident with gradle and have probably done something obviously wrong.
Some extra info:
- Android Studio v0.3.6
- Android SDK Build-tools rev 19
- Gradle version 1.8
Any ideas on how to fix this?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…