Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

My app crashes when trying to inflate the com.google.android.material.chip.Chip class.

The dependency i am using is implementation 'com.google.android.material:material:1.0.0'

Here is my XML code

 <com.google.android.material.chip.Chip
        android:id="@+id/chipActive"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:chipCornerRadius="5dp"
        android:backgroundTint="@color/primaryColor"
        android:textColor="@color/primaryTextColor"
        android:textAlignment="center"
        android:fontFamily="@font/roboto_regular"
        android:layout_marginStart="10dp"
        android:text="Active"/>

The error I get is

 android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class com.google.android.material.chip.Chip
    at android.view.LayoutInflater.inflate(LayoutInflater.java:551)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:429)

I found a question similar to mine on another thread but there was no solution there that was helpful to me. If anyone has any suggestions on how to fix this issue please help me :D

Update your app theme to inherit from one of these themes as shown here: stackoverflow.com/questions/51877777/… – Volodymyr Jan 9, 2019 at 8:57

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.