我試圖通過使用Gradle插件的Jenkins構建Android應用程序。當我申請該應用程序時,我在下面粘貼了以下例外。此應用程序使用Android Studio運行良好,但無法使用Jenkins構建。請讓我知道,可能是什麼問題。Jenkins Gradle構建問題(任務':app:processPackagingOptionsDebugResources'的執行失敗。)
C:\Program Files (x86)\Jenkins\workspace\Test\AndroidApp\app\src\main\res\values-v21\styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ProgressBar.Horizontal'.
C:\Program Files (x86)\Jenkins\workspace\Test\AndroidApp\app\src\main\res\values-v21\styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.DrawerArrowToggle'.
C:\Program Files (x86)\Jenkins\workspace\Test\AndroidApp\app\src\main\res\values-v21\styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name '@style/Widget.AppCompat.Light.ActionBar'.
C:\Program Files (x86)\Jenkins\workspace\Test\AndroidApp\app\src\main\res\values-v21\styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name '@style/TextAppearance.AppCompat.Widget.ActionBar.Title'.
C:\Program Files (x86)\Jenkins\workspace\Test\AndroidApp\app\src\main\res\values-v21\styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
C:\Program Files (x86)\Jenkins\workspace\Test\AndroidApp\app\src\main\res\values-v21\styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
C:\Program Files (x86)\Jenkins\workspace\Test\AndroidApp\app\src\main\res\values-v21\styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name '@style/Widget.AppCompat.ActionMode'.
FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processPackagingOptionsDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\AndroidStudioSDK\build-tools\23.0.2\aapt.exe'' finished with non-zero exit value 1
請看以下的build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
class BooleanExtension {
boolean value
BooleanExtension(boolean value) {
this.value = value
}
public void setValue(boolean value) {
this.value = value
}
public boolean getValue() {
return value
}
}
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
// def voiceSearch = false;
defaultConfig {
applicationId 'com.packageid'
versionName "1.0.0"
minSdkVersion 19
targetSdkVersion 22
versionCode 10000
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
debuggable false
jniDebuggable false
renderscriptDebuggable false
renderscriptOptimLevel 3
zipAlignEnabled true
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.google.android.gms:play-services-analytics:7.8.0'
compile 'com.google.android.gms:play-services-base:7.8.0'
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
}
我從價值V21也被刪除的風格,那麼我得到下面的異常
Files (x86)\Jenkins\workspace\Test\app\src\main\res\values\strings.xml:2 : Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
C:\Program Files (x86)\Jenkins\workspace\Test\app\src\main\res\values\strings.xml:2 : Unexpected end tag string
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-hdpi\values-hdpi.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.Widget.AppCompat.DrawerArrowToggle.Common'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\design\23.1.0\res\values-sw600dp\values-sw600dp.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.Widget.Design.TabLayout'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\design\23.1.0\res\values-land\values-land.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.Widget.Design.TabLayout'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-large\values-large.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.Theme.AppCompat.Dialog.FixedSize'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-large\values-large.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.Theme.AppCompat.Light.Dialog.FixedSize'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-v11\values-v11.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Dialog'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-v11\values-v11.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Light.Dialog'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-v12\values-v12.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Widget.AppCompat.AutoCompleteTextView'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-v12\values-v12.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Widget.AppCompat.EditText'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-v17\values-v17.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.DialogWindowTitle.AppCompat'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-v21\values-v21.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat'.
C:\Program Files (x86)\Jenkins\workspace\Test\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.0\res\values-v21\values-v21.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Light'.
可能重複[找不到與給定名稱相匹配的資源'android:Theme.Material.Light.DarkActionBar'](http://stackoverflow.com/questions/24529534/no-resource-found-that-matches-給定名稱 - androidtheme-material-light-dark) – Chaoz