0

I encountered this error when attempting to add

compile "com.android.support:support-core-utils:23.2.1"

to build.gradle for my mobile app. Here is the entire build.gradle (mobile) apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "21.1.2"
    defaultConfig {
        applicationId "com.xxxxxxx.sam.collegegrader"
        minSdkVersion 10
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })
    wearApp project(':wear')
    compile 'com.google.android.gms:play-services:9.8.0'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:support-core-utils:23.2.1'
}

SDK Manager

This is my first android app so, I may have just made a beginner mistake. Here are the problem solving steps that I have taken:

Failed to resolve: com.android.support:appcompat-v7:15.+ - Didn't have the support library downloaded

https://developer.android.com/studio/intro/update.html#sdk-manager - Followed tutorial to add the library

https://developer.android.com/topic/libraries/support-library/setup.html#using-apis - Added compile to build.gradle (mobile)

failed to resolve com.android.support:appcompat-v7:22 and com.android.support:recyclerview-v7:21.1.2 - I believe that I have the correct version # in build.gradle (23.2.1)

Here is where I am trying to use android:theme="@style/ThemeOverlay.AppCompat.Dark.Actionbar" res/layout/activity_view_college.xml Here is where I am trying to use android:theme="@style/ThemeOverlay.AppCompat.Dark.Actionbar"

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.xxxxxx.sam.collegegrader.ViewCollegeActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar_layout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:theme="@style/ThemeOverlay.AppCompat.Dark.Actionbar"
        android:fitsSystemWindows="true" >
    </android.support.design.widget.AppBarLayout>

    <!--<TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/text_margin"
        android:text="@string/large_text" />-->


</android.support.design.widget.CoordinatorLayout>

styles.xml

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
    </style>

    <style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

    <style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />

</resources>

styles.xml (v21)

<resources>

    <style name="AppTheme.NoActionBar">
        <item name="windowActionBar">false</item>
        <item name="windowNoTitle">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">true</item>
        <item name="android:statusBarColor">@android:color/transparent</item>
    </style>
</resources>
Community
  • 1
  • 1
kir13y
  • 69
  • 1
  • 2
  • 10

1 Answers1

1

You're getting this error because the support-core-utils library was part of the v4 Support Library in v23.2.1.

With the release of v24.2.0, the v4 Support Library has been split into several smaller modules one of which is support-core-utils. For more information on the split check the following link: https://developer.android.com/topic/libraries/support-library/revisions.html#24-2-0-v4-refactor

So the solution to your issue is to use a newer version of support-core-utils library such as 25.0.1.

Dmitri Timofti
  • 2,428
  • 1
  • 22
  • 25
  • Thanks! One more thing: I was trying to add this library to eventually solve `Error:(13, 24) No resource found that matches the given name (at 'theme' with value '@style/ThemeOverlay.AppCompat.Dark.Actionbar').` I still have that error and I thought that it was included in support-core-utils. Do I need to declare something in the xml file that has the actionbar? – kir13y Dec 01 '16 at 17:25
  • this theme is included in the appcompat library that appears to be present in your build.gradle script. Are you using this style directly in your layout or do you have in declared in styles.xml? Can you update the question with the layout/file where you use this style? – Dmitri Timofti Dec 01 '16 at 17:43
  • I updated the question with more info. I use it in styles.xml and a few other places that are all throwing errors. – kir13y Dec 05 '16 at 16:05
  • The 'android:theme' line is out of place, you problably don't need it, so I would suggest removing it. to apply a style to a view, use the 'style' attribute. 'android:theme' is only used for activity or application tags. For more info visit https://developer.android.com/guide/topics/ui/themes.html – Dmitri Timofti Dec 07 '16 at 11:12