1. 程式人生 > >gradle與jenkins編譯常見報錯及解決

gradle與jenkins編譯常見報錯及解決

一、jenkins編譯錯誤總結
1.錯誤一:                         
/data/jenkins/workspace/tv-child-release/tvApp/libraryPrj/lecore/src/com/letv/core/utils/DevicesUtils.java:1335: error: cannot find symbol
            isSupport = LetvManager.isSupportEyeProtection();
                                   ^
  symbol:   method isSupportEyeProtection()
  location: class LetvManager
/data/jenkins/workspace/tv-child-release/tvApp/libraryPrj/lecore/src/com/letv/core/utils/DevicesUtils.java:1351: error: cannot find symbol
            LetvManager.setEyeProtectionMode(context, pictureMode);
                       ^
  symbol:   method setEyeProtectionMode(Context,int)
  location: class LetvManager
Note: /data/jenkins/workspace/tv-child-release/tvApp/libraryPrj/lecore/src/com/letv/core/timer/LetvTimeFetcher.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
6 errors

Incremental compilation of 26 classes completed in 4.407 secs.
:libraryPrj:lecore:compileReleaseJavaWithJavac FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':libraryPrj:lecore:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 10.094 secs

第一次構建的時候出的問題,
解決:再編譯一次就成功了!
2.錯誤二:  
+ ./gradlew --daemon :tv-letvApp:aCR
Incremental java compilation is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'aCR' is ambiguous in project ':tv-letvApp'. Candidates are: 'assembleCibnRelease', 'assembleCommonRelease'.
解決:更改aCR為assembleCibnRelease!
3.錯誤三:  

* What went wrong:
Execution failed for task ':libraryPrj:payLib:processCibnReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/share/androidsdk/sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 43.329 secs
Build step 'Execute shell' marked build as failure
Sending e-mails to: ${GERRIT_CHANGE_OWNER_EMAIL}@le.com 
[email protected]
Finished: FAILURE
解決:rm -rf tvApp, 再編譯一次!
4.錯誤四:  

FAILURE: Build failed with an exception.

* What went wrong:
Gradle build daemon disappeared unexpectedly (it may have been killed or may have crashed)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Build step 'Execute shell' marked build as failure
Sending e-mails to: ${GERRIT_CHANGE_OWNER_EMAIL}@le.com [email protected]
Finished: FAILURE
解決: 再編譯一次就成功了!
5.錯誤五:  

 ./leChildMasterBuildRelease 

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':libraryPrj:payLib:processCibnReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Users/caiwei/Library/Android/sdk/build-tools/21.1.2/aapt'' finished with non-zero exit value 1
解決: Build - clean Project, 再編譯一次!
二、gradle編譯常見錯誤總結1.Error:Configuration with name 'default' not found.
build.gradle檔案依賴設定不正確

2.Execution failed for task ':leso:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/caiwei/software/install/jdk/jdk1.7.0_67/bin/java'' finished with non-zero exit value 2
包名衝突:如leso和lesoSearchLib都為com.letv.leso 需要修改 並更改各個類R檔案的引用
3.UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Landroid/support/v4/view/PagerAdapter;
Error:Execution failed for task ':leso:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/caiwei/software/install/jdk/jdk1.7.0_67/bin/java'' finished with non-zero exit value 2
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.Main.main(Main.java:106)
at com.android.dx.command.dexer.Main.main(Main.java:215)
Error:Execution failed for task ':leso:dexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/home/caiwei/software/install/jdk/jdk1.7.0_67/bin/java'' finished with non-zero exit value 2原因:libs/下的android support v4包重複
4.Error:A problem occurred configuring project ':leso'.
> A problem occurred configuring project ':libraryPrj:lesoSearchLib'.
   > A problem occurred configuring project ':libraryPrj:letvCore'.
      > Could not resolve all dependencies for configuration ':libraryPrj:letvCore:_debugCompile'.
         > Could not resolve pl.droidsonroids.gif:android-gif-drawable:1.1.+.
           Required by:
               LetvApp.libraryPrj:letvCore:unspecified
            > No cached version listing for pl.droidsonroids.gif:android-gif-drawable:1.1.+ available for offline mode.
            > No cached version listing for pl.droidsonroids.gif:android-gif-drawable:1.1.+ available for offline mode.
原因: Settings--Gradle--Global Gradle settings -- Offline work(打了勾)
5.
Warning: can't write resource [bin/AndroidManifest.xml] (Duplicate zip entry [imageloader_1.9.3_forbid_longconnect.jar:bin/AndroidManifest.xml])
:leso:dexRelease
:leso:processReleaseJavaRes UP-TO-DATE
:leso:shrinkReleaseResources
Removed unused resources: Binary resource data reduced from 8367KB to 8253KB: Removed 1%
Note: If necessary, you can disable resource shrinking by adding
android {
    buildTypes {
        release {
            shrinkResources false
        }
    }
}
:leso:validateReleaseSigning
:leso:packageReleaseError: duplicate files during packaging of APK /data/jenkins/workspace/tv-client-leso/client/LetvApp/leso/build/outputs/apk/leso-release-unaligned.apk
	Path in archive: bin/AndroidManifest.xml
	Origin 1: /data/jenkins/workspace/tv-client-leso/client/LetvApp/leso/libs/pluginframework.jar
	Origin 2: /data/jenkins/workspace/tv-client-leso/client/LetvApp/leso/build/intermediates/exploded-aar/LetvApp.libraryPrj/letvCore/unspecified/libs/imageloader_1.9.3_forbid_longconnect.jar
You can ignore those files in your build.gradle:
	android {
	  packagingOptions {
	    exclude 'bin/AndroidManifest.xml'
	  }
	}
 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':leso:packageRelease'.
> Duplicate files copied in APK bin/AndroidManifest.xml
  	File 1: /data/jenkins/workspace/tv-client-leso/client/LetvApp/leso/libs/pluginframework.jar
  	File 2: /data/jenkins/workspace/tv-client-leso/client/LetvApp/leso/libs/pluginframework.jar


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 2 mins 24.385 secs
+ exit $'1\357\274\233'
/tmp/hudson579191790894082888.sh: line 30: exit: 1;: numeric argument required
Build step 'Execute shell' marked build as failure
Sending e-mails to: [email protected] [email protected]
Finished: FAILURE
在這它在抱怨重複在同一個檔案,這是不同於其他類似的錯誤。這些都是我不適用情形:
android {
	  packagingOptions {
	    exclude 'bin/AndroidManifest.xml'
	  }
	}
6.
Error:Execution failed for task ':app:transformClassesWithJarMergingForXXXDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoIcsImpl.class
  • 1
  • 2
  • 1
  • 2
報錯大概的意思是說,添加了重複的Suppot/v4包,看了專案libs中已經有個v4,發現Project A中也引用了v4包 compile ‘com.Android.support:support-v4:19.0.1’,
解決:compile (project(':A')) { exclude module: 'support-v4'}

相關推薦

gradlejenkins編譯見報解決

一、jenkins編譯錯誤總結 1.錯誤一:   /data/jenkins/workspace/tv-child-release/tvApp/libraryPrj/lecore/src/com/letv/core/ut

struts2學習筆記——見報解決方法匯總(持續更新)

允許 clip 之間 con ack 技術 ext tro height 操作環境:(1)Tomcat 7.0.72.0      (2)OS Name: Windows 7      (3)JVM Version: 1.8.0_25-b18      (4)e

Hexo 搭建博客 本地運行 見報解決辦法

render error: 錯誤 exp 手動配置 fig.yml 文件中 size server 作為一名在hexo方面的新手,我在使用hexo編輯文檔時遇到了很多問題,hexo generate編譯的時候遇到了各種錯誤。 在此將這些錯誤及其解決方案記錄下來,以便日後查證

Git見報解決方案

報錯一: You have not concluded your merge (MERGE_HEAD exists). Please, commit your changes before you can merge. 錯誤可能是因為在你以前pull下來的程式碼沒有自動合併導致的。  

匯入別人Java專案的兩個見報解決方法

1.在Eclipse 中編寫servlet時出現:The import javax.servlet cannot be resolved 錯誤,如下圖 ![https://img-blog.csdn.net/20160814155837035?watermark/2/text/aHR0cDo

MySQL見報解決方案

ERROR 1136 (21S01): Column count doesn’t match value count at row 1 ERROR 1136 (21S01): Column count doesn't match value count at row 1 出現原

見報解決方案

一.資料庫或SQL相關   1.無效的列型別 1111很大可能是欄位型別對不上,看實體類,xml,和資料庫,採用欄位二分排除法排查,還有可能是引數為空 mybatis.configuration.jdbc-type-for-null = NULL   而當引數

rsync見報解決方法

我們都是通過錯誤日誌檢視 在rsyncd.log裡面或.err檔案裡面,大家可以用記事本開啟檢視。 注意windows下面我們需要給SvcwRsync使用者,管理同步目錄的所有許可權,基本上這樣就可以了 問題一: @ERROR: chroot

MacOSX上ab併發測試見報解決辦法

1、apr_socket_recv: Connection reset by peer (54) Shell 12345678Mac:~air$ab-n10000-c2000http://127.0.0.1:80/ThisisApacheBench,Vers

Django2.0 應用 Xadmin 見報解決辦法

1、django2.0把from django.core.urlresolvers修改成了django.urls 報錯如下: File "D:\Envs\django-xadmin\lib\site-packages\xadmin-0.6.1-py3.6.egg\xa

[轉][Oracle]見報處理

oracl 備份 歸檔 -- log .com del com cmd 1、ORA-00257 參考自:https://jingyan.baidu.com/article/f71d6037ccf1301ab641d1f0.html 查詢 select * from V$FL

iOS - 將Unity匯出的Xcode工程匯入到另一個Xcode專案, 見報解決方法

demo下載地址 http://pan.baidu.com/s/1pLcpKpl 1.Unity匯出工程時設定bundle id要與專案一致 2.修改bit code為NO 3.刪除Main.storyboard,程式碼設定控制器(方便切

Python基礎學習篇-7 各種見報原因----【不定時補充】

1、TypeError: int(x) argument must be a string, a bytes-like object or a number, not 'NoneType' 此報錯是因為使用 int() 函式進行強制型別轉換時,要求引數x必須是字串、位元組物件、數字,不能是其它的

將Unity匯出的Xcode工程匯入到另一個Xcode專案, 見報解決方法

1.Unity匯出工程時設定bundle id要與專案一致 2.修改bit code為NO 3.刪除Main.storyboard,程式碼設定控制器(方便切換window) 4.將Classes,Libraries,MapFileParser.sh拖

iOS整合Unity專案,將Unity匯出的Xcode工程匯入到另一個Xcode專案,見報解決方法

1.Unity匯出工程時設定bundle id要與專案一致 2.修改bit code為NO 3.刪除Main.storyboard,程式碼設定控制器(方便切換window)

Appium見報問題解決方法-2

ron authorize 點擊 設備 auth .so 方案 成功 正常 上一篇記錄了部分Appium報錯的解決方案,現在繼續記錄 4、運行閃退 直接如上運行,閃退。 解決方法: 運行前,要先啟動Appium客戶端,之後再運行腳本,就不會出現這個問題。 5.socke

MySQL主從同步見報解決辦法2

MySQL ERROR 1872 報錯截圖如下:該報錯屬於SQL線程報錯,原因是relay -index.index 和relay-log裏面的文件路徑對應不上。解決辦法: mysql> stop slave;mysql> reset slave;重新指定主庫信息mysql> ch

ubuntu使用apt命令見報以及解決方案

報錯: E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable) E: Unable to lock the administration directory

Java向Mysql資料庫中儲存圖片等二進位制檔案的實現,以及見報解決

Mysql資料庫的功能很強大,除了能儲存字元等常見資料以外,它同樣可以儲存圖片等二進位制檔案,本文以儲存照片為例。 一、Mysql儲存二進位制檔案常見報錯有: 1.com.mysql.jdbc.PacketTooBigException: Packet for query

ueditor百度編輯器見報解決方法

如果是第一次使用ueditor百度編輯器,或者對它不熟悉的情況下使用,會出現一些常見問題和報錯。怎麼使用建議參考ueditor官網,這裡只談一些常見錯誤。問題:‘UE’ is not defind我是在vue中呼叫UE裡面的方法時遇到的這個問題。這是ESlint的程式碼風格警