【发布时间】:2016-01-30 17:16:22
【问题描述】:
我想创建一个使用 SharedPreferences 的库。现在要这样做,我需要有 android.jar 可供我使用。但是,由于我的项目永远不会独立运行,因此我非常怀疑将其作为一个成熟的 android 应用程序是否是正确的方法。
现在我有以下 build.gradle:
apply plugin: 'eclipse'
apply plugin: 'maven'
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
}
}
apply plugin: 'android-library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: '*.jar')
testCompile 'junit:junit:4.12'
testCompile 'org.slf4j:slf4j-simple:1.6.1'
}
}
还有如下错误:
FAILURE:构建失败并出现异常。
出了什么问题:配置根项目“NetworkSynchronizer”时出现问题。
java.io.FileNotFoundException: D:\Users\Beheerder\git\NetworkSynchronizer\src\main\AndroidManifest.xml (系统找不到指定的文件)
尝试:使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。
这是正确的方法吗,我应该添加一个 AndroidManifest.xml,还是应该如何处理?
【问题讨论】: