Android XML -- Error inflating class com.google.android.material.floatingactionbutton.FloatingActionButton | Failed to resolve attribute at index
Ни с того ни с сего возникла такая ошибка при запуске активити. При этом, сам XML, а также темы и стили, я не менял. Вот полный логкат:
java.lang.RuntimeException: Unable to start activity ComponentInfo{special.hometask.viewer/special.hometask.viewer.activities.MainActivity}: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class com.google.android.material.floatingactionbutton.FloatingActionButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3430)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: android.view.InflateException: Binary XML file line #20: Binary XML file line #20: Error inflating class com.google.android.material.floatingactionbutton.FloatingActionButton
Caused by: android.view.InflateException: Binary XML file line #20: Error inflating class com.google.android.material.floatingactionbutton.FloatingActionButton
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:658)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:801)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:874)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835)
at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:751)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:197)
at special.hometask.viewer.activities.MainActivity.onCreate(MainActivity.java:468)
at android.app.Activity.performCreate(Activity.java:7458)
at android.app.Activity.performCreate(Activity.java:7448)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3409)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3614)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2199)
at android.os.Handler.dispatchMessage(Handler.java:112)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7625)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:987)
Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 79: TypedValue{t=0x2/d=0x7f0301f4 a=-1}
at android.content.res.TypedArray.getColorStateList(TypedArray.java:580)
at android.view.View.<init>(View.java:5412)
at android.widget.ImageView.<init>(ImageView.java:198)
2024-08-06 19:35:48.125 28821-28821 AndroidRuntime special.hometask.viewer E at android.widget.ImageButton.<init>(ImageButton.java:86)
at android.widget.ImageButton.<init>(ImageButton.java:82)
at com.google.android.material.internal.VisibilityAwareImageButton.<init>(VisibilityAwareImageButton.java:47)
at com.google.android.material.floatingactionbutton.FloatingActionButton.<init>(FloatingActionButton.java:212)
at com.google.android.material.floatingactionbutton.FloatingActionButton.<init>(FloatingActionButton.java:206)
... 28 more
Не могу понять, что такое случилось... В интернете советуют тольк проверить, что тема стоит правильная, но моя тема уже давно наследуется от Theme.Material3.Dark.NoActionBar
.
XML-РАЗМЕТКА:
<com.google.android.material.floatingactionbutton.FloatingActionButton
android:id="@+id/chatFab"
style="@style/FAB"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_gravity="bottom|end"
android:layout_margin="16dp"
android:foregroundTint="?attr/fabIconColor"
app:backgroundTint="?attr/fabColor"
app:layout_constraintBottom_toTopOf="@id/bottomNav"
app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/chat" />
Стиль FAB:
<style name="FAB" parent="Widget.Material3.FloatingActionButton.Primary">
<item name="materialThemeOverlay">@style/ThemeOverlay.App.FloatingActionButton</item>
</style>
<style name="SmallFAB" parent="Widget.Material3.FloatingActionButton.Small.Primary">
<item name="colorContainer">?attr/smallFabColor</item>
<item name="tint">?attr/smallFabIconColor</item>
</style>
<style name="ThemeOverlay.App.FloatingActionButton" parent="">
<item name="colorContainer">?attr/fabColor</item>
<item name="colorOnContainer">?attr/fabIconColor</item>
</style>
Буду благодарен за любую помощь!