Android 不推荐使用的属性的渐变警告
我不明白gradle为什么不建造?我使用Android Studio,Gradle 1.12 build.gradleAndroid 不推荐使用的属性的渐变警告,android,unit-testing,gradle,android-studio,jacoco,Android,Unit Testing,Gradle,Android Studio,Jacoco,我不明白gradle为什么不建造?我使用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'
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'
}
当我将gradle与project同步时,它会抛出警告:
信息:渐变任务[:app:generateDebugSources]
警告:按需配置是一项酝酿功能。
警告:依赖包装来定义主设备的扩展
工件已被弃用,计划在Gradle中删除
2.0警告:Test.testReportDir属性已被弃用,并计划在Gradle 2.0中删除。请使用
改为Test.getReports().getHtml().getDestination()属性。
:app:preBuild:app:preDebugBuild:app:checkDebugManifest
:app:preReleaseBuild:app:preStageBuild
:app:prepareComgoogleandroidgmsplayservices4452最新库
:app:prepareDebugDependencies:app:compiledbugaidl最新
:app:CompiledBugRenderScript最新:app:GeneratedBugBuildConfig
最新:应用程序:合并调试资产最新
:app:generateDebugResValues最新:app:generateDebugResources
最新:应用程序:合并调试资源最新
:app:processDebugManifest最新:app:processDebugResources
最新:应用程序:生成错误源最新信息:生成
成功信息:总时间:6.457秒信息:0个错误
信息:3条警告
问题出在插件“GradleAndroid测试插件”中。JakeWharton宣布此插件已弃用。也许是因为这不是一个计划。我删除了插件并更改了build.gradle文件:
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'
}
它说构建成功,而你说构建不成功。我真糊涂!没关系,因为应用程序仍然没有运行。