Android gradle support design error

This was my build.gradle

file:

...
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.android.support:cardview-v7:21.0.+'
    ...
}

      

before adding:

compile 'com.android.support:design:22.2.0'

      

Now when I build or rebuild the project (I syncronized several times gradle

) I get the following errors:

.../utils/CustomEditText.java
Error:(6, 42) Gradle: error: cannot find symbol class TintEditText
Error:(14, 35) Gradle: error: cannot find symbol class TintEditText
Error:(37, 8) Gradle: error: cannot find symbol method isInEditMode()
Error:(57, 3) Gradle: error: cannot find symbol method setTypeface(Typeface)
Error:(65, 5) Gradle: error: method does not override or implement a method from a supertype
Error:(67, 23) Gradle: error: cannot find symbol variable super
...

      

Inside mine CustomEditText

(which extends TintEditText

) and inside all operations that use this CustomEditText

.

The import does not throw any error, but Class:

import android.support.v7.internal.widget.TintEditText;

      


What could it be?

UPDATE: Using Proposition ianhanniballake , AppCompatEditText

instead of internal TintEditText

, solves time compilation error and responds to this question, but now I have a run-time error:

java.lang.IllegalArgumentException: AppCompat does not support the current theme features 

      

I saw some question related to this and the solution mentioned was something like:

<style name="MyMaterialTheme" parent="Theme.AppCompat.NoActionBar">
        <item name="windowNoTitle">true</item>
        <item name="windowActionBar">false</item>
        ...
</style>

      

But I don't want to use this approach, because I have Activities

which are using ActionBar

and others are not. My styles:

<style name="MyTheme" parent="Theme.AppCompat.Light">
        <item name="colorControlNormal">@color/txt_light_grey</item>
        <item name="colorControlActivated">@color/default_orange</item>
        <item name="colorControlHighlight">@color/txt_light_grey</item>
    </style>

    <style name="MyTheme.ActionBar.Orange" parent="MyTheme">
        <item name="windowActionBarOverlay">false</item>
        <item name="colorPrimary">@color/default_orange</item>
    </style>

    <style name="MyTheme.FullScreen" parent="MyTheme">
        <item name="windowActionBar">false</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowFullscreen">true</item>
        <item name="android:windowContentOverlay">@null</item>
    </style>

      

And inside my base Activity

I do:

getWindow().requestFeature(mActionBarView != null ? Window.FEATURE_ACTION_BAR : Window.FEATURE_NO_TITLE);

      

To enable or disable ActionBar

.
As I said, it works very well as long as I did not add 'com.android.support:design:22.2.0'

or update appcompat-v7:22.0.0

to 22. 2 .0. I just want to use TabLayout

, but I think I won't ...

+3


source to share


1 answer


As of AppCompat 22.1.0 , you must use AppCompatEditText instead of internal TintEditText

.



+5


source







All Articles