2

I was trying to get the Support7Demos to build, but I kept running into problems.

Initial errors:

Error:(23, 21) No resource found that matches the given name: attr 'colorAccent'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
Error:(23, 21) No resource found that matches the given name: attr 'colorAccent'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(35, 21) No resource found that matches the given name: attr 'alertDialogTheme'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Dialog.Alert'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(35, 21) No resource found that matches the given name: attr 'alertDialogTheme'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(35, 21) No resource found that matches the given name: attr 'alertDialogTheme'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog.Alert'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog.Alert'.
Error:(21, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(22, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:Execution failed for task ':app:processDebugResources'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '***'' finished with non-zero exit value 1

Changed compilesDkVersion to 21 and my targetSdkVersion to 21 as well. No difference.

Then I changed:

compile 'com.android.support:appcompat-v7:18.0.+'

to

compile 'com.android.support:appcompat-v7:21.0.+'

Now I am getting:

Error:(35, 21) No resource found that matches the given name: attr 'alertDialogTheme'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Dialog.Alert'.
Error:(35, 21) No resource found that matches the given name: attr 'alertDialogTheme'.
Error:(35, 21) No resource found that matches the given name: attr 'alertDialogTheme'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog.Alert'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog.Alert'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '***'' finished with non-zero exit value 1

Finally changed compile 'com.android.support:appcompat-v7:21.0.+' to v23 as it recommended...But this is where I run into a wall. Final errors:

Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '***'' finished with non-zero exit value 1

My best google search led to Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23 but if I change the compile version to 23 then I just get a host of new errors and I'm back to square 1.

Here is my build.gradle that gives the least amount of errors:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 21
    buildToolsVersion '23.0.1'

    defaultConfig {
        applicationId "com.example.android.supportv7"
        minSdkVersion 7
        targetSdkVersion 21
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.0.+'
}

As a note, changing the build tools didn't seem to do anything.

Community
  • 1
  • 1
Bill Wates
  • 47
  • 4

1 Answers1

2

I builded Support7Demos an hour ago. It's my first attempt to migrate to Android Studio after working few years in Eclipse. To make build working after fresh importing Support7Demos I had make this:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "com.example.android.supportv7"
        minSdkVersion 7
        targetSdkVersion 23
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.android.support:cardview-v7:23.1.0'
    compile 'com.android.support:gridlayout-v7:23.1.0'
    compile 'com.android.support:palette-v7:23.1.0'
    compile 'com.android.support:mediarouter-v7:23.1.0'
    compile 'com.android.support:recyclerview-v7:23.1.0'
}

I mean that your main problem is that Support7Demos requires more dependencies. And correct compileSdkVersion, targetSdkVersion and buildToolsVersion installed on your machine.

All dependencies that I have listed are required. I added them one by one and each resolving some errors until everything starts working.

Dmitry Ratty
  • 425
  • 1
  • 10
  • 13