2014-06-06 53 views
1

我不明白,爲什麼gradle不會構建?我使用Android Studio,Gradle 1.12。棄用財產的Gradle警告

的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' 
} 

當我的gradle同步與項目扔警告:

信息:搖籃任務[:應用:generateDebugSources] 警告:按需配置是孵化功能。 警告:依靠包裝來定義主 工件的擴展已被棄用,並計劃在Gradle中刪除 2.0警告:Test.testReportDir屬性已被棄用,並計劃在Gradle 2.0中刪除。請使用 Test.getReports()。getHtml()。getDestination()屬性。 :應用程序:預生成:應用程序:preDebugBuild:應用程序:checkDebugManifest :應用程序:preReleaseBuild:應用程序:preStageBuild :應用程序:prepareComGoogleAndroidGmsPlayServices4452Library UP-TO-DATE :應用程序:prepareDebugDependencies:應用程序:compileDebugAidl UP-TO-DATE :應用程序: 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最新信息:BUILD SUCCESSFUL信息:總時間:6.457秒信息:0 err ors 信息:3警告

+1

它說BUILD BUILD SUCCESSFUL,你說這個構建不成功。我感到很困惑! –

+0

沒關係,因爲應用程序都一樣沒有運行。 – Viacheslav

回答

1

問題出在插件「gradle-android-test-plugin」中。傑克華頓宣佈這個插件已被棄用。馬比可能是因爲這不會投影。我刪除了插件,並更改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' 
}