簡體   English   中英

排除junit lib從在Android Studio中構建apk

[英]exclude junit lib from building apk in android studio

我有計划從eclipse導入的Android Studio。 我已經開始對該項目進行單元測試。 這是添加的依賴項,

dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    // Unit testing dependencies
    compile 'junit:junit:4.12'
    // Set this dependency if you want to use Mockito
    compile 'org.mockito:mockito-core:1.10.19'
    // some more ..
}

當我構建.apk文件時,此.apk包含junit庫。 如何從.apk中排除該junit庫? 最近幾天我一直在搜索這些問題,但可以找到解決方案。 請幫我。

使用testCompile而不是針對單元測試依賴項進行compile androidTestCompile用於工具測試的依賴關系。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM