-1

I am trying to build Android App through Jenkins, using Gradle Plugin. When I buld the application, I am getting the following exception pasted below. This application is runnning well using Android Studio, but unable to build using Jenkins. Please let me know, what could be the issue.

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

Please find the build.gradle below:

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:2.5.0@aar') {
        transitive = true;
    }
}

I also removed style from value-v21 then I get the following Exception

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'.
Safy
  • 31
  • 6
  • Possible duplicate of [No resource found that matches the given name 'android:Theme.Material.Light.DarkActionBar'](http://stackoverflow.com/questions/24529534/no-resource-found-that-matches-the-given-name-androidtheme-material-light-dark) – Chaoz Mar 06 '16 at 12:35

1 Answers1

0

The very first thing to note is that (Execution failed for task ':app:processPackagingOptionsDebugResources'.) is not the error. That is the Gradle error, caused by an error in your app. That "error in your app" is the actual error.

Above that Gradle error, you can see multiple app errors (here are 2 examples):

styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ProgressBar.Horizontal'.
styles.xml:2 : Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.DrawerArrowToggle'.

These are your actual errors. Now about these. You can see it says:

No resource found that matches the given name 'Widget.AppCompat.DrawerArrowToggle'.

Usually this is caused by a problem in your build.gradle file. At the android {...} part, make sure you have the compile sdk and build tools version set to the newest versions. Because you use "values-21", you should use v21 for compiling too:

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.1"
}

Hope this helped!

Chaoz
  • 1,710
  • 1
  • 18
  • 34
  • Yes , I am using the latest version compileSdkVersion 23 buildToolsVersion "23.0.2" – Safy Mar 06 '16 at 12:52
  • Then this may help you: http://stackoverflow.com/questions/21059612/no-resource-found-that-matches-the-given-name-style-theme-appcompat-light – Chaoz Mar 06 '16 at 12:55
  • Any more suggesstions, I have updated the issue in more details. – Safy Mar 08 '16 at 04:46
  • The same Gradle works well in Android Studio, but not working with Jenkins? Any Suggestions. – Safy Mar 09 '16 at 14:04
  • @Safy Try using "@android:style/Widget.AppCompat" instead – Chaoz Mar 09 '16 at 14:32