Я пытаюсь использовать кодовую метку MDC на codelabs.developers.google.com с последними версиями библиотеки. EditText - android.support.design.widget.TextInputEditText
кажется, работает должным образом, однако при использовании android.support.design.button.MaterialButton создается исключение InflateException во время выполнения.
Конфигурация Gradle:
compileSdkVersion 28
minSdkVersion 21
targetSdkVersion 28
dependencies {
def lifecycle_version = "1.1.1"
def nav_version = "1.0.0-alpha05"
def work_version = "1.0.0-alpha06"
def supportLibraryVersion = "28.0.0-rc01"
implementation fileTree(include: ['*.jar'], dir: 'libs')
api "android.arch.lifecycle:extensions:$lifecycle_version"
api "android.arch.lifecycle:common-java8:$lifecycle_version"
api "android.arch.navigation:navigation-fragment:$nav_version"
api "android.arch.navigation:navigation-ui:$nav_version"
api "android.arch.work:work-runtime:$work_version"
api ("com.android.support:appcompat-v7:$supportLibraryVersion", {
exclude group: 'com.android.support', module: 'support-media-compat'
})
api ("com.android.support:design:$supportLibraryVersion", {
exclude group: 'com.android.support', module: 'support-media-compat'
})
api ("com.android.support:cardview-v7:$supportLibraryVersion", {
exclude group: 'com.android.support', module: 'support-media-compat'
})
api ("com.android.support:customtabs:$supportLibraryVersion", {
exclude group: 'com.android.support', module: 'support-media-compat'
})
...
Трассировки стека
E/XXXXXXApp: Unhandled Exception - Application Crash
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.XXXXXX/com.XXXXXX.activities.XXXXXXActivity}: android.view.InflateException: Binary XML file line #84: Binary XML file line #84: Error inflating class android.support.design.button.MaterialButton
at com.XXXXXXActivity.onCreate(LoginActivity.java:107)
...
Caused by: java.lang.IllegalArgumentException: This component requires that you specify a valid TextAppearance attribute. Update your app theme to inherit from Theme.MaterialComponents (or a descendant).
at android.support.design.internal.ThemeEnforcement.checkTextAppearance(ThemeEnforcement.java:170)
at android.support.design.internal.ThemeEnforcement.obtainStyledAttributes(ThemeEnforcement.java:75)
at android.support.design.button.MaterialButton.<init>(MaterialButton.java:140)
at android.support.design.button.MaterialButton.<init>(MaterialButton.java:133)
РЕДАКТИРОВАТЬ: добавил больше деталей в stacktrace и выяснил, что проблема была в том, что тема приложения должна быть унаследована от Theme.MaterialComponents.