Hier ist der build.gradle meines App-Moduls:< /p>
Code: Select all
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "my.package"
minSdkVersion 21
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':offlinetasks')
compile project(':tasks')
compile project(':models')
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'org.roboguice:roboguice:3.0.1'
provided 'org.roboguice:roboblender:3.0.1'
compile 'com.android.support:support-annotations:22.1.1'
compile('org.reflections:reflections:0.9.10') {
exclude module: 'xml-apis'
exclude module: 'annotations'
}
testCompile 'junit:junit:4.12'
testCompile('com.squareup.assertj:assertj-android:1.0.0') {
exclude module: 'support-annotations'
}
}
[img]https://i.sstatic.net /FSRaT.png[/img]
Nachdem ich es manuell zum Klassenpfad hinzugefügt habe, kann ich die Klasse importieren. Wenn ich jedoch versuche, es zu starten, erhalte ich die folgende Fehlermeldung:
Code: Select all
tasks:compileReleaseJava
/.../TaskFactory.java:8: error: package org.reflections does not exist
import org.reflections.Reflections;
Bearbeiten:
Mein Projekt build.gradle sieht so aus:
Code: Select all
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}