我正在构建一个带有gradle的Android库,但是会遇到类似这样的错误:
/Users/scott/dev/libs/mysqlitedatabase-android/mysqlitedatabase-android-
library/src/main/java/com/mypackage/android/sub/MyDatabaseSync.java:
14: error: package org.codehaus.jackson does not exist
import org.codehaus.jackson.JsonParser;
^
这是我用来生成javadoc的gradle任务:
task generateJavadoc (type: Javadoc) {
def variant = android.libraryVariants.release
title = "$project.name $version API"
description "Generates Javadoc for $project.name."
source = android.sourceSets.main.java.srcDirs
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
classpath += project.files(source) + files(variant.processJavaResources.destinationDir)
options.links("http://docs.oracle.com/javase/7/docs/api/");
options.links("http://d.android.com/reference/");
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
之前我已经构建了许多库,但是使用了较旧的gradle版本。我在这个场合使用gradle 1.12。