Estou com erro ao executar o app (logCat):
java.lang.RuntimeException: Unable to start activity ComponentInfo{br.com.alura.orgs/br.com.alura.orgs.ui.activity.ListaProdutoActivity}: android.view.InflateException: Binary XML file line #33 in br.com.alura.orgs:layout/activity_lista_produto: Binary XML file line #33 in br.com.alura.orgs:layout/activity_lista_produto: Error inflating class com.google.android.material.floatingactionbutton.FloatingActionButton
...
Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.AppCompat (or a descendant).
...
meu arquivo themes.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Orgs" parent="android:Theme.Material.Light.DarkActionBar" />
<!--
<style name="Theme.Orgs" parent="android:Theme.Material.Light.NoActionBar" />
-->
<!--
<style name="Theme.Orgs" parent="android:Theme.MaterialComponents.DayNight" />
-->
<style name="Theme.Orgs.NoActionBar">
<item name="windowActionBar">true</item>
<item name="windowNoTitle">true</item>
</style>
<style name="Theme.Orgs.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="Theme.Orgs.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
meu arquivo build.grade (app):
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.jetbrains.kotlin.android)
}
android {
namespace 'br.com.alura.orgs'
compileSdk 34
defaultConfig {
applicationId "br.com.alura.orgs"
minSdk 31
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
// sourceCompatibility JavaVersion.VERSION_1_8
// targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
// jvmTarget = '1.8'
jvmTarget = '17'
}
buildFeatures {
compose true
viewBinding true
}
composeOptions {
kotlinCompilerExtensionVersion '1.5.1'
}
packaging {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
// buildscript {
// repositories {
// mavenCentral()
// maven {
// url "https://maven.google.com"
// }
// }
// dependencies {
// classpath 'com.android.tools.build:gradle:3.2.1'
// }
// }
}
dependencies {
// implementation "androidx.cardview:cardview:1.0.0"
implementation libs.androidx.cardview
// implementation 'com.google.android.material:material:1.7.0-rc01'
// implementation libs.material3
// implementation libs.androidx.material3
implementation libs.androidx.material
implementation libs.androidx.material.android
// implementation libs.androidx.appcompat
// implementation 'com.google.android.material:material:1.12.0'
// implpementation 'androidx.compose.material:material:1.6.7'
// implpementation libs.androidx.material
implementation libs.androidx.activity.compose
implementation libs.androidx.constraintlayout
implementation libs.androidx.recyclerview
implementation libs.material
// implementation libs.compose.theme.adapter
implementation libs.androidx.appcompat
implementation libs.androidx.material.android
implementation libs.appcompat
// implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation libs.junit
androidTestImplementation libs.androidx.junit
androidTestImplementation libs.androidx.espresso.core
// implementation libs.androidx.material
}
meu arquivo build.grade (projeto):
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.jetbrains.kotlin.android) apply false
}