2014-06-10 32 views
1

我無法使用新的清單合併器進行構建。 Gradle抱怨說我的測試使用minSdkVersion="14",而Espresso有minSdkVersion="8"。我實際上沒有清單我的測試文件夾(androidTest),但看起來清單合併器正在臨時文件夾中創建一個文件夾。使用Espresso測試minSdkVersion =「14」的項目時出現Manifest Merger錯誤

溫度艙單,通過合併而成:

<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" /> 

    <application> 
     <uses-library android:name="android.test.runner" /> 
    </application> 

    <instrumentation android:name="com.google.android.apps.common.testing.testrunner.GoogleInstrumentationTestRunner" 
        android:targetPackage="mypackage.android" 
        android:handleProfiling="false" 
        android:functionalTest="false" 
        android:label="Tests for mypackage.android"/> 
</manifest> 

錯誤和調試日誌:

Merging uses-sdk with lower test manifest:5:5 
Merging application with lower test manifest:7:5 
Merging result:ERROR        
{PATH_TO_PROJECT}\build\intermediates\exploded-aar\com.jakewharton.espresso\espresso\1.1-r2\AndroidManifest.xml:0:0 Error: 
     uses-sdk:minSdkVersion 8 cannot be smaller than version 14 declared in library test manifest 
:MyApp:processDebugTestManifest FAILED   
:MyApp:processDebugTestManifest (Thread[Daemon Thread 6,5,main]) completed. Took 0.107 secs. 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':MyApp:processDebugTestManifest'. 
> java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 8 cannot be smaller than version 14 declared in library test manifest 

任何想法,我能做些什麼來解決這個問題,或者是與一個bug明確合併?

回答

1

嘗試加入這一行到您的build.gradle

android { 
    useOldManifestMerger true 
    ... 
} 
+1

我不希望使用舊清單合併,我需要這個工作。 –