Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

Android Basics: display-list-cards #6

Closed
CoryBouchard opened this issue Oct 13, 2020 · 2 comments
Closed

Android Basics: display-list-cards #6

CoryBouchard opened this issue Oct 13, 2020 · 2 comments
Assignees

Comments

@CoryBouchard
Copy link

URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-display-list-cards

In which task and step of the codelab can this issue be found?
Use cards

Describe the problem
020-10-13 17:28:41.611 11073-11073/com.example.affirmations E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.affirmations, PID: 11073
android.view.InflateException: Binary XML file line #2 in com.example.affirmations:layout/list_item: Binary XML file line #2 in com.example.affirmations:layout/list_item: Error inflating class com.google.android.material.card.MaterialCardView
Caused by: android.view.InflateException: Binary XML file line #2 in com.example.affirmations:layout/list_item: Error inflating class com.google.android.material.card.MaterialCardView
Caused by: java.lang.reflect.InvocationTargetException

Steps to reproduce?

  1. Run Affirmations app
  2. See error above

Versions
What version of Android Studio are you using?
4.0.2

Additional information
Include screenshots if they would be useful in clarifying the problem.

@gszesiek
Copy link

Hello, you should notice the same error after update TextView: "android:textAppearance="?attr/textAppearanceHeadline6""

To solve this error update your styles.xml from <style name="AppTheme" parent="Theme.MaterialComponents.DayNight"> to <style name="AppTheme" parent="Theme.MaterialComponents.DayNight">

@android-dev-lxl android-dev-lxl self-assigned this Oct 20, 2020
@android-dev-lxl
Copy link

@CoryBouchard Thank you for reaching out to us.

Since you’re using Android Studio 4.0.x, make this change to your res > values > styles.xml file. Change the parent app theme from Theme.AppCompat.Light.DarkActionBar to Theme.MaterialComponents.DayNight.DarkActionBar.

<style name="Theme.Affirmations" parent="Theme.MaterialComponents.DayNight.DarkActionBar">

It is highly recommended to always use the latest version of the Android Studio. Current latest version is Android Studio 4.1.
@gszesiek Thank you for the response.

Thank you so much for reporting this issue. This is fixed and will be published soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants