【发布时间】:2016-01-28 15:21:04
【问题描述】:
我在我的 android studio 中有一个 android 项目 (gradl),我有一个 maven 模块,我想在我的 android 项目中使用。结构如下:
- Android 项目 (gradle)
- 子项目(gradle)
- --build.gradle
- MyFancyStuff (gradle)
- -- ...
- build.gradle
- settings.gradl
- 共享模型(Maven 项目)
- pom.xml
- ...
现在我将我的settings.gradle 调整如下:
include ':MyFancyStuff',':shared-models'
project(':shared-models').projectDir = new File('../shared-models')
我从其他几个 stackoverflow 主题中得到了这个。
现在是子项目的build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 18
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'MyFancyStuff:MyFancyStuff-debug@aar'
compile 'org.codehaus.jackson:jackson-mapper-asl:1.9.0'
compile 'com.sun.jersey:jersey-client:1.9.1'
compile 'com.google.code.gson:gson:1.7.2'
compile project(':shared-models')
}
repositories{
flatDir{
dirs 'libs'
}
ivy {
url "../shared-models"
}
}
现在我收到以下错误:
错误:找不到名为“默认”的配置。
基于stackoverflow上的其他线程,不知道是什么问题...
【问题讨论】:
标签: android maven gradle android-gradle-plugin