Reputation: 531
I don't understand, why gradle doesn't build? I use Android Studio, Gradle 1.12.
build.gradle
apply plugin: 'android'
apply plugin: 'android-test'
apply plugin: "jacoco"
repositories {
maven { url '***' }
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
testPackageName "***"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
buildTypes {
debug {
packageNameSuffix ".debug"
runProguard false
testCoverageEnabled = true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
jacoco {
version = '0.6.2.201302030002'
}
testOptions {
resultsDir = "$project.buildDir/jacoco"
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.activeandroid:activeandroid:3.1'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:4.4.52'
compile 'com.squareup.picasso:picasso:2.2.0'
testCompile('org.mockito:mockito-all:1.9.5') {
exclude module: 'hamcrest'
}
compile 'com.google.dexmaker:dexmaker-mockito:1.0'
testCompile 'com.google.dexmaker:dexmaker:1.0'
testCompile 'junit:junit:4.11'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.1'
}
When I sync gradle with project it throw warnings:
Information:Gradle tasks [:app:generateDebugSources] Warning:Configuration on demand is an incubating feature. Warning:Relying on packaging to define the extension of the main artifact has been deprecated and is scheduled to be removed in Gradle 2.0 Warning:The Test.testReportDir property has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the Test.getReports().getHtml().getDestination() property instead. :app:preBuild :app:preDebugBuild :app:checkDebugManifest :app:preReleaseBuild :app:preStageBuild :app:prepareComGoogleAndroidGmsPlayServices4452Library UP-TO-DATE :app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE :app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources UP-TO-DATE :app:mergeDebugResources UP-TO-DATE :app:processDebugManifest UP-TO-DATE :app:processDebugResources UP-TO-DATE :app:generateDebugSources UP-TO-DATE Information:BUILD SUCCESSFUL Information:Total time: 6.457 secs Information:0 errors Information:3 warnings
Upvotes: 2
Views: 3497
Reputation: 531
The problem was in the plugin "gradle-android-test-plugin". JakeWharton announced this plugin as deprecated. Maby probably because this is not going to project. I removed plugin and change build.gradle file:
apply plugin: 'android'
apply plugin: "jacoco"
repositories {
maven { url '***' }
}
android {
compileSdkVersion 19
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 14
targetSdkVersion 19
versionCode 1
versionName "1.0"
testPackageName "***"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
testHandleProfiling true
testFunctionalTest true
}
packagingOptions {
exclude 'LICENSE.txt'
}
buildTypes {
debug {
packageNameSuffix ".debug"
runProguard false
testCoverageEnabled = true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
test {
packageNameSuffix ".test"
runProguard false
testCoverageEnabled = true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
jacoco {
version = '0.6.2.201302030002'
}
testOptions {
resultsDir = "$project.buildDir\\jacoco"
}
lintOptions {
abortOnError false
}
}
dependencies {
compile 'com.activeandroid:activeandroid:3.1'
compile 'com.android.support:support-v4:19.1.0'
compile 'com.google.code.gson:gson:2.2.4'
compile 'com.google.android.gms:play-services:4.4.52'
compile 'com.squareup.picasso:picasso:2.2.0'
compile('org.mockito:mockito-all:1.9.5') {
exclude module: 'hamcrest'
}
androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
androidTestCompile 'com.google.dexmaker:dexmaker:1.0'
androidTestCompile 'junit:junit:4.11'
androidTestCompile 'com.jayway.android.robotium:robotium-solo:5.1'
}
Upvotes: 1