我有一个困难的时间,因为gradle 1.1与机器人电气工作。我阅读了一些教程--我们尝试了一些东西,但都没有效果。
这是我的项目build.gradle文件:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'org.robolectric:robolectric-gradle-plugin:1.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}知更鸟的电子下载完毕,这是我的模块build.gradle:
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "br.com.boozeprice"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
apply plugin: 'org.robolectric'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile project(':androidcore')
compile project(':persistencecore')
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:2.4'
}gradle编译和所有的东西,但它似乎我没有在项目中的库,我不能导入机器人电子类,也不能他们的注释。
我是不是遗漏了什么?
提前谢谢你。
发布于 2015-04-01 01:08:41
为了使它工作,我所做的是更改gradle文件上的这一行:
testCompile 'junit:junit:4.12'
testCompile 'org.robolectric:robolectric:2.4'对此:
androidTestCompile 'junit:junit:4.12'
androidTestCompile 'org.robolectric:robolectric:2.4现在就像一种魅力
https://stackoverflow.com/questions/29336466
复制相似问题