android build failed
問題1:
Warning:Conflict with dependency 'com.google.code.findbugs:jsr305'.
Resolved versions for app (3.0.1) and test app (2.0.1) differ.
See http://g.co/androidstudio/app-test-app-conflict for details.
原因分析:
使用第三方的外掛,但是外掛在定義自身依賴時,使用[version+]策略,導致永遠下載最新的依賴
但是該外掛所指定倉庫並沒有最新版本的依賴,從而導致構建失敗。
解決方案:
Gradle強制依賴解析策略,指定某個依賴必須是這個版本
參考:
http://www.voidcn.com/blog/BenW1988/article/p-5011566.html
問題2:匯入AAR
解決方案
1、把aar檔案放在一個檔案目錄內,比如就放在libs目錄內
2、在app的build.gradle檔案新增如下內容
repositories {
flatDir {
dirs 'libs' //this way we can find the .aar file in libs folder
}
}
3、之後在其他專案中新增一句gradle依賴便方便的引用了該library
dependencies {
compile(name:'test' , ext:'aar')
}
參考
問題3:transformResourcesWithMergeJavaResForDebug
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/rxjava.properties
File1: C:\Users \gzh_006\.gradle\caches\modules-2\files-2.1\io.reactivex\rxjava\1.1.5\ece7b5d0870e66d8226dab6dcf47a2b12afff061\rxjava-1.1.5.jar
File2: C:\Users\gzh_006\.gradle\caches\modules-2\files-2.1\io.reactivex.rxjava2\rxjava\2.0.1\57f850a6b317e5582f1dbaff10a9e7d7e1fcdcfb\rxjava-2.0.1.jar
解決方案
//build.gradle android 節點下
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
相關推薦
android build failed
問題1: Warning:Conflict with dependency 'com.google.code.findbugs:jsr305'. Resolved versions for ap
android studio 3.2+ FAILURE: Build failed with an exception.
FAILURE: Build failed with an exception. What went wrong: Execution failed for task ‘:baselibrary:compileDebugJavaWithJavac’. Compilation
Android:解決Failed to load D:\Android-Studio\sdk\build-tools\xx.xx.xx\lib\dx.jar
Eclipse遇到如下錯誤: [2018-11-04 18:11:46 - Dex Loader] Failed to load G:\Android Tools\android-sdk-w
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.tran
報錯: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.tran 包此型別的錯,大多是資原始檔引用的衝突,看後面具體的衝突原
Android Studio開發 -- BUILD FAILED -- R檔案丟失 解決方案
Android Studio開發 -- BUILD FAILED -- R檔案丟失 解決方案 原來直接複製進來的圖片格式是jpg ,需要轉成 png ,後重新編譯就可以了 R檔案丟失!!!我最開心的就是遇見這個了,因為我寫過關於R檔案丟失問題解決方案彙總,怎麼也難不住我吧,
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.a
原 Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.a
android build successful, run failed.
昨天在將專案依賴由module切換到私服上打好包的aar時,執行時慣例出現了找不到xxx檔案的提示,隨後clean了一下,build successful, 但發現run時還是出錯,沒辦法只好invalidate cache大法,漫長的等待後,發現gg,竟然還是跑不起來。報錯
Android Studio BUILD FAILED finished with non-zero exit value
Android Studio build failed Android studio gradle 編譯失敗 錯誤提示:finished with non-zero exit value 1finis
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/ColorRes.class
導致 .class div src jar 技術 cnblogs 沖突 信息 保存信息如上: 我在添加一個支持庫的時候遇的問題,這個庫com.yanzhenjie:album:1.0.5 這是由於v4包重復導致的,在網上我也找過多種解決方案 用了這種,方式 confi
Android 異常: failed to connect to localhost/127.0.0.1
col host 本地 led style 本地計算機 str 異常 需要 連接本地web服務器,在模擬器不能連接到127.0.0.1。 Android把127.0.0.1當作模擬器本機,而把計算機本地IP設為10.0.2.2,需要把需連接本地計算機web服務地址改為:ht
FAILURE: Build failed with an exception.
exceptio jdk run span eva project conf code nbsp 執行react-native run-android報錯: A problem occurred configuring project ‘:app‘. Failed to
【Vue報錯】Module build failed: Error: No parser and no file path given, couldn't infer a p arser.
3.0 OS could modules exp ports -- hot loader 在創建一個vue項目啟動時報錯,報錯的內容為: error in ./src/App.vue Module build failed: Error: No parser and no
macOS 開發 - 使用 Packages 打包失敗:"build failed"
平時用 packages 打包很正常,今日打包失敗,還只是報個 build failed ,沒有其他更多錯誤資訊也是很崩潰。 後面一檢查,發現是因為把這個 包拖到了另外一個資料夾,導致 readme.txt 、introduction.txt 等檔案因為繫結的絕對位置失效,所以報紅。
Android Error:Failed to complete Gradle execution. Cause: The version of Gradle you are using (3.3)
Android 打包錯誤: Error:Failed to complete Gradle execution. Cause: The version of Gradle you are using (3.3) does not support the forTasks() me
Android Build類
Log.i(TAG,"裝置引數:"+Build.DEVICE); Log.i(TAG,"顯示屏引數:"+Build.DISPLAY); Log.i(TAG,"硬體製造商:"+Build.MANUFACTURER); Log.i(TAG,"產品名:"+B
Android Build names/Tags/Numbers for Rockchip Freescale etc
https://source.android.com/setup/start/build-numbers++ ........ Source Code Tags and Builds Build Branch
Android Build names/Tags/Numbers Update 201810/Android9.0-Pie
https://source.android.com/setup/start/build-numbers Codenames, Tags, and Build Numbers Android development happens around families of releases th
Vue, element-ui Module build failed: Error: No PostCSS Config found
使用vue框架寫pc頁面時,我們經常會用到element-ui這個框架。 當我們吧把需要的東西都裝在好執行專案的時候,有時會出現這樣的錯誤, Module build failed: Error: No PostCSS Config found 這是因為缺少了一個配置檔案,需要重新建立一個檔案: pos
【已解決】上傳專案到binary 上面的時候報錯:FAILURE: Build failed with an exception.
zhangyinshandeMacBook-Pro:BaseLibs zhangyinshan$ ./gradlew install FAILURE: Build failed with an exception. * Where: Build file '/Users/zhangyinsh
com.android.build.gradle.tasks.ResourceException:Error: java.util.concurrent.ExecutionException:com.
事情的起因是,改版後,設計改了一個圖示,我放上去再打包就出現這個錯誤了,網上搜了好多,嘗試過修改 gradle.properties,新增 android.enableAapt2=false,但是無效。嘗試過修改 gradble 快取路徑(File -> Setting