Material Component Library version 1.1.0 not working - android

I want to use the startIconDrawable feature that is present in the material component library version 1.1.0. But when I upgrade from version 1.0.0 to version 1.1.0, the outlined box disappears and the activity crashes. Please Help
<com.google.android.material.textfield.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="#+id/username"
android:layout_marginTop="20dp"
android:hint="Username"
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
Log after clicking the button
2020-06-04 21:09:55.873 5024-5024/com.example.digidocsbeta E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.digidocsbeta, PID: 5024
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.digidocsbeta/com.example.digidocsbeta.Login}: android.view.InflateException: Binary XML file line #53 in com.example.digidocsbeta:layout/activity_login: Binary XML file line #53 in com.example.digidocsbeta:layout/activity_login: Error inflating class com.google.android.material.textfield.TextInputLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3448)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
Caused by: android.view.InflateException: Binary XML file line #53 in com.example.digidocsbeta:layout/activity_login: Binary XML file line #53 in com.example.digidocsbeta:layout/activity_login: Error inflating class com.google.android.material.textfield.TextInputLayout
Caused by: android.view.InflateException: Binary XML file line #53 in com.example.digidocsbeta:layout/activity_login: Error inflating class com.google.android.material.textfield.TextInputLayout
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.example.digidocsbeta.Login.onCreate(Login.java:12)
at android.app.Activity.performCreate(Activity.java:7955)
at android.app.Activity.performCreate(Activity.java:7944)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3423)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3595)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7814)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1068)
2020-06-04 21:09:55.874 5024-5024/com.example.digidocsbeta E/AndroidRuntime: Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:248)
at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:222)
at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:150)
at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:120)
at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:424)
at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:396)
... 30 more
2020-06-04 21:09:55.895 5024-5024/com.example.digidocsbeta I/Process: Sending signal. PID: 5024 SIG: 9

Related

Error inflating Text Input Layout even though MaterialComponent style is used

I am trying to use TextInputLayout from Materials Components. Even tho my style is like this:
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar", I am getting an error.
I have looked through all the similar questions on web(including stack overflow). All of them suggest to change the theme from appCompat to materialComponents, but i have already done that.
This the part of the XML that causes the error
(line 34) <com.google.android.material.textfield.TextInputLayout
android:id="#+id/til_title"
style="#style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
error itself:
Caused by: android.view.InflateException: Binary XML file line #34 in com.example.happyplaces:layout/activity_add_happy_place: Binary XML file line #34 in com.example.happyplaces:layout/activity_add_happy_place: Error inflating class com.google.android.material.textfield.TextInputLayout
i have materialcomponents dependency in the build file:
implementation 'com.google.android.material:material:1.7.0-alpha03'
here is the full stack trace:
2022-08-15 10:08:31.489 16671-16671/com.example.happyplaces E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.happyplaces, PID: 16671
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.happyplaces/com.example.happyplaces.AddHappyPlaceActivity}: android.view.InflateException: Binary XML file line #34 in com.example.happyplaces:layout/activity_add_happy_place: Binary XML file line #34 in com.example.happyplaces:layout/activity_add_happy_place: Error inflating class com.google.android.material.textfield.TextInputLayout
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3271)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7397)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by: android.view.InflateException: Binary XML file line #34 in com.example.happyplaces:layout/activity_add_happy_place: Binary XML file line #34 in com.example.happyplaces:layout/activity_add_happy_place: Error inflating class com.google.android.material.textfield.TextInputLayout
Caused by: android.view.InflateException: Binary XML file line #34 in com.example.happyplaces:layout/activity_add_happy_place: Error inflating class com.google.android.material.textfield.TextInputLayout
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1126)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at com.example.happyplaces.databinding.ActivityAddHappyPlaceBinding.inflate(ActivityAddHappyPlaceBinding.java:104)
at com.example.happyplaces.databinding.ActivityAddHappyPlaceBinding.inflate(ActivityAddHappyPlaceBinding.java:98)
at com.example.happyplaces.AddHappyPlaceActivity.onCreate(AddHappyPlaceActivity.kt:12)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3246)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3410)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7397)
2022-08-15 10:08:31.491 16671-16671/com.example.happyplaces E/AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:241)
at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:215)
at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:143)
at com.google.android.material.internal.ThemeEnforcement.obtainTintedStyledAttributes(ThemeEnforcement.java:113)
at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:467)
at com.google.android.material.textfield.TextInputLayout.<init>(TextInputLayout.java:446)
... 31 more
i cant find out what causes the error here. Any help would be very appreciated.
The problem is I was still using AppCompat library for another style. That was the cause. It took me one day to figure out.

My app works on emulator but crashes on device on startup

In my android dev in kotlin course, I create a simple to do list, the list seems perfectly fine, no error in coding everything is fixed I run the app on my emulator and it works perfectly fine, but when I run and test it it through my device through usb connection, it just crashes on startup everytime, Now I have no idea why:
I try to change the emulator api though I dont know if emulator has to do anything with it I also deleted Android Api 32 from sdk manager because I was working with that and I installed Android 10.0 because I use the same version on my device I thought it might actualy help but still nothing I take a look at the error code but there is so much into it I understand nothing this is what it shows in logcat :
2022-03-16 23:10:29.788 17445-17445/? E/om.example.tod: Unknown bits set in runtime_flags: 0x8000
2022-03-16 23:10:30.308 17445-17445/com.example.todo E/libc: Access denied finding property "ro.vendor.df.effect.conflict"
2022-03-16 23:10:30.490 17445-17445/com.example.todo E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.todo, PID: 17445
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.todo/com.example.todo.MainActivity}: android.view.InflateException: Binary XML file line #2 in com.example.todo:layout/activity_main: Binary XML file line #2 in com.example.todo:layout/activity_main: Error inflating class <unknown>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3335)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3484)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2068)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
Caused by: android.view.InflateException: Binary XML file line #2 in com.example.todo:layout/activity_main: Binary XML file line #2 in com.example.todo:layout/activity_main: Error inflating class <unknown>
Caused by: android.view.InflateException: Binary XML file line #2 in com.example.todo:layout/activity_main: Error inflating class <unknown>
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:858)
at android.view.LayoutInflater.createView(LayoutInflater.java:780)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:934)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:954)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
at android.view.LayoutInflater.inflate(LayoutInflater.java:663)
at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:706)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
at com.example.todo.MainActivity.onCreate(MainActivity.kt:24)
at android.app.Activity.performCreate(Activity.java:7893)
at android.app.Activity.performCreate(Activity.java:7880)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3310)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3484)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2068)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
Caused by: android.content.res.Resources$NotFoundException: Drawable com.example.todo:color/material_dynamic_neutral20 with resource ID #0x7f0501a4
2022-03-16 23:10:30.491 17445-17445/com.example.todo E/AndroidRuntime: Caused by: android.content.res.Resources$NotFoundException: Resource "com.example.todo:color/material_dynamic_neutral20" (7f0501a4) is not a Drawable (color or path): TypedValue{t=0x1/d=0x7f0501a4 a=-1 r=0x7f0501a4}
at android.content.res.ResourcesImpl.loadDrawableForCookie(ResourcesImpl.java:856)
at android.content.res.ResourcesImpl.originalLoadDrawable(ResourcesImpl.java:696)
at android.content.res.ResourcesImpl.loadDrawable(ResourcesImpl.java:593)
at android.content.res.MiuiResourcesImpl.loadDrawable(MiuiResourcesImpl.java:307)
at android.content.res.Resources.loadDrawable(Resources.java:932)
at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:1007)
at android.content.res.TypedArray.getDrawable(TypedArray.java:982)
at android.view.View.<init>(View.java:5304)
at android.view.ViewGroup.<init>(ViewGroup.java:684)
at android.widget.LinearLayout.<init>(LinearLayout.java:254)
at android.widget.LinearLayout.<init>(LinearLayout.java:250)
at android.widget.LinearLayout.<init>(LinearLayout.java:246)
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:858)
at android.view.LayoutInflater.createView(LayoutInflater.java:780)
at com.android.internal.policy.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:58)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:934)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:954)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1010)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
at android.view.LayoutInflater.inflate(LayoutInflater.java:663)
at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:706)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:195)
at com.example.todo.MainActivity.onCreate(MainActivity.kt:24)
at android.app.Activity.performCreate(Activity.java:7893)
at android.app.Activity.performCreate(Activity.java:7880)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3310)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3484)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2068)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7551)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:995)
change the color code of your resource
<color name="material_dynamic_neutral20">#7f0501a4</color> to <color name="material_dynamic_neutral20">#7F1712D1</color>

Android app crashes when I add a layout element with an id (BottomNavigationView)

EDIT: SOLVED (in the worst way possible)
Turns out my hard drive is corrupted. I'm sorry for wasting your time.
I'm currently running into a error. When coding yesterday, everything worked and went smoothly. Now, all of a sudden, my app crashes for some reason.
Whenever I add a layout element with an id, say:
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/newButton"/>
the app crashes on run.
However, if I remove the ID, so that the layout code would be something like:
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"/>
the app runs normally.
This is the logCat error I get:
2020-08-04 14:33:14.994 17775-17775/com.example.cloooset E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.cloooset, PID: 17775
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.cloooset/com.simonbergmark.cloooset.MainActivity}: android.view.InflateException: Binary XML file line #8 in com.example.cloooset:layout/activity_main: Binary XML file line #8 in com.example.cloooset:layout/activity_main: Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3632)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3784)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2270)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8125)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Caused by: android.view.InflateException: Binary XML file line #8 in com.example.cloooset:layout/activity_main: Binary XML file line #8 in com.example.cloooset:layout/activity_main: Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView
Caused by: android.view.InflateException: Binary XML file line #8 in com.example.cloooset:layout/activity_main: Error inflating class com.google.android.material.bottomnavigation.BottomNavigationView
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.simonbergmark.cloooset.MainActivity.onCreate(MainActivity.kt:44)
at android.app.Activity.performCreate(Activity.java:7957)
at android.app.Activity.performCreate(Activity.java:7946)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3607)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3784)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2270)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8125)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
2020-08-04 14:33:14.995 17775-17775/com.example.cloooset E/AndroidRuntime: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.setImportantForAccessibility(int)' on a null object reference
at androidx.core.view.ViewCompat.setImportantForAccessibility(ViewCompat.java:1119)
at com.google.android.material.bottomnavigation.BottomNavigationItemView.<init>(BottomNavigationItemView.java:101)
at com.google.android.material.bottomnavigation.BottomNavigationItemView.<init>(BottomNavigationItemView.java:84)
at com.google.android.material.bottomnavigation.BottomNavigationItemView.<init>(BottomNavigationItemView.java:80)
at com.google.android.material.bottomnavigation.BottomNavigationMenuView.getNewItem(BottomNavigationMenuView.java:589)
at com.google.android.material.bottomnavigation.BottomNavigationMenuView.buildMenuView(BottomNavigationMenuView.java:521)
at com.google.android.material.bottomnavigation.BottomNavigationPresenter.updateMenuView(BottomNavigationPresenter.java:67)
at com.google.android.material.bottomnavigation.BottomNavigationView.inflateMenu(BottomNavigationView.java:344)
at com.google.android.material.bottomnavigation.BottomNavigationView.<init>(BottomNavigationView.java:226)
at com.google.android.material.bottomnavigation.BottomNavigationView.<init>(BottomNavigationView.java:133)
... 28 more
This is the BottomNavigationView code:
<com.google.android.material.bottomnavigation.BottomNavigationView
android:id="#+id/nav_view"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginEnd="0dp"
android:background="?android:attr/windowBackground"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:menu="#menu/bottom_nav_menu" />
And this is MainActivity:44
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val navView: BottomNavigationView = findViewById(R.id.nav_view)
Kindly help

Material Design Floating Action Button requires app theme to be Theme.MaterialComponents (mine is)

I added a floating action button to my activity, but I'm getting an error and a crash every time I open that activity. The error is:
E/UncaughtException: Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
Which seems obvious, right? Make my app theme a descendant of Theme.MaterialComponenets. But I did that and the error didn't go away.
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="android:editTextStyle">#style/edittext_style</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
the relevant portions of the KMainActivity2
class KMainActivity2 : AppCompatActivity() {
private val handler by lazy { Handler() }
private val mainActivityViewModel by lazy {
getViewModel { MainActivity2VM(application) }
}
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_kmain2)
setTheme(R.style.AppTheme_NoActionBar)
Logger.addLogAdapter(AndroidLogAdapter())
FirebaseApp.initializeApp(this)
setupBinding()
}
}
The portions of my manifest
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="watch.trigger.android">
<application
android:name=".TriggerWatch"
android:allowBackup="true"
android:fullBackupContent="#xml/backup_descriptor"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:largeHeap="true"
android:networkSecurityConfig="#xml/network_security_config"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".ui.main.KMainActivity2"
android:theme="#style/AppTheme.NoActionBar" />
</application>
</manifest>
The full stacktrace
2020-06-21 13:12:04.263 6505-10240/? E/Finsky: [560] the.a(9): Unexpected experiment flag type found for flag ContentSync__settle_delay
com.google.android.flib.log.WhatATerribleException: java.lang.ClassCastException: Cannot cast [B to atie
at afdp.b(PG:3)
at com.google.android.finsky.utils.FinskyLog.b(PG:5)
at the.a(PG:9)
at the.j(PG:2)
at hah.a(Unknown Source:6)
at arsr.a(PG:2)
at arst.run(PG:9)
at aruw.run(Unknown Source:7)
at kqv.execute(PG:1)
at arux.execute(PG:1)
at arsp.b(PG:20)
at arsp.a(PG:16)
at arsp.b(PG:27)
at arss.a(PG:3)
at arst.run(PG:12)
at aruw.run(Unknown Source:7)
at kqv.execute(PG:1)
at arux.execute(PG:1)
at arsp.b(PG:20)
at arsp.a(PG:16)
at arsp.b(PG:27)
at arvn.a(PG:2)
at aruq.run(PG:11)
at arvo.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at kqs.run(Unknown Source:14)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.ClassCastException: Cannot cast [B to atie
at java.lang.Class.cast(Class.java:2446)
at the.a(PG:8)
at the.j(PG:2) 
at hah.a(Unknown Source:6) 
at arsr.a(PG:2) 
at arst.run(PG:9) 
at aruw.run(Unknown Source:7) 
at kqv.execute(PG:1) 
at arux.execute(PG:1) 
at arsp.b(PG:20) 
at arsp.a(PG:16) 
at arsp.b(PG:27) 
at arss.a(PG:3) 
at arst.run(PG:12) 
at aruw.run(Unknown Source:7) 
at kqv.execute(PG:1) 
at arux.execute(PG:1) 
at arsp.b(PG:20) 
at arsp.a(PG:16) 
at arsp.b(PG:27) 
at arvn.a(PG:2) 
at aruq.run(PG:11) 
at arvo.run(Unknown Source:4) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at kqs.run(Unknown Source:14) 
at java.lang.Thread.run(Thread.java:919) 
2020-06-21 13:12:04.335 2058-2080/? E/system_server: Invalid ID 0x00000000.
2020-06-21 13:12:04.413 2058-2058/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/data/app/watch.trigger.android-zFcVqi_RP-07ZaTuYABaZw==/lib/x86, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:256)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:370)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5951)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1941)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at com.android.server.SystemServer.run(SystemServer.java:541)
at com.android.server.SystemServer.main(SystemServer.java:349)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:908)
2020-06-21 13:12:04.414 2058-2058/? E/LoadedApk: Unable to instantiate appComponentFactory
java.lang.ClassNotFoundException: Didn't find class "androidx.core.app.CoreComponentFactory" on path: DexPathList[[],nativeLibraryDirectories=[/data/app/watch.trigger.android-zFcVqi_RP-07ZaTuYABaZw==/lib/x86, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.LoadedApk.createAppFactory(LoadedApk.java:256)
at android.app.LoadedApk.updateApplicationInfo(LoadedApk.java:370)
at android.app.ActivityThread.handleDispatchPackageBroadcast(ActivityThread.java:5951)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1941)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at com.android.server.SystemServer.run(SystemServer.java:541)
at com.android.server.SystemServer.main(SystemServer.java:349)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:908)
2020-06-21 13:12:04.435 6505-10240/? E/Finsky: [560] the.a(9): Unexpected experiment flag type found for flag ContentSync__settle_delay
com.google.android.flib.log.WhatATerribleException: java.lang.ClassCastException: Cannot cast [B to atie
at afdp.b(PG:3)
at com.google.android.finsky.utils.FinskyLog.b(PG:5)
at the.a(PG:9)
at the.j(PG:2)
at hah.a(Unknown Source:6)
at arsr.a(PG:2)
at arst.run(PG:9)
at aruw.run(Unknown Source:7)
at kqv.execute(PG:1)
at arux.execute(PG:1)
at arsp.b(PG:20)
at arsp.a(PG:16)
at arsp.b(PG:27)
at arss.a(PG:3)
at arst.run(PG:12)
at aruw.run(Unknown Source:7)
at kqv.execute(PG:1)
at arux.execute(PG:1)
at arsp.b(PG:20)
at arsp.a(PG:16)
at arsp.b(PG:27)
at arvn.a(PG:2)
at aruq.run(PG:11)
at arvo.run(Unknown Source:4)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at kqs.run(Unknown Source:14)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.ClassCastException: Cannot cast [B to atie
at java.lang.Class.cast(Class.java:2446)
at the.a(PG:8)
at the.j(PG:2) 
at hah.a(Unknown Source:6) 
at arsr.a(PG:2) 
at arst.run(PG:9) 
at aruw.run(Unknown Source:7) 
at kqv.execute(PG:1) 
at arux.execute(PG:1) 
at arsp.b(PG:20) 
at arsp.a(PG:16) 
at arsp.b(PG:27) 
at arss.a(PG:3) 
at arst.run(PG:12) 
at aruw.run(Unknown Source:7) 
at kqv.execute(PG:1) 
at arux.execute(PG:1) 
at arsp.b(PG:20) 
at arsp.a(PG:16) 
at arsp.b(PG:27) 
at arvn.a(PG:2) 
at aruq.run(PG:11) 
at arvo.run(Unknown Source:4) 
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
at kqs.run(Unknown Source:14) 
at java.lang.Thread.run(Thread.java:919) 
2020-06-21 13:12:04.444 10301-10301/? E/trigger.androi: Unknown bits set in runtime_flags: 0x8000
2020-06-21 13:12:04.633 6900-6979/? E/MicroDetectionWorker: Stale runnable..ignoring
2020-06-21 13:12:05.547 1807-2098/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2020-06-21 13:12:05.547 1807-2098/? E/SurfaceFlinger: ro.sf.lcd_density must be defined as a build property
2020-06-21 13:12:05.955 10432-10432/? E/ProcessService: Not starting debugger since process cannot load the jdwp agent.
2020-06-21 13:12:06.094 10301-10463/watch.trigger.android E/chromium: [ERROR:gl_surface_egl.cc(342)] eglChooseConfig failed with error EGL_SUCCESS
2020-06-21 13:12:06.148 10301-10463/watch.trigger.android E/chromium: [ERROR:gl_surface_egl.cc(342)] eglChooseConfig failed with error EGL_SUCCESS
2020-06-21 13:12:09.186 2439-3287/? E/ActivityThread: Failed to find provider info for com.google.android.apps.wellbeing.api
2020-06-21 13:12:11.908 1940-1940/? E/netmgr: Failed to open QEMU pipe 'qemud:network': Invalid argument
2020-06-21 13:12:12.029 1944-1944/? E/wifi_forwarder: RemoteConnection failed to initialize: RemoteConnection failed to open pipe
2020-06-21 13:12:14.646 2058-2086/? E/memtrack: Couldn't load memtrack module
2020-06-21 13:12:19.055 10301-10301/watch.trigger.android E/AndroidRuntime: FATAL EXCEPTION: main
Process: watch.trigger.android, PID: 10301
java.lang.RuntimeException: Unable to start activity ComponentInfo{watch.trigger.android/watch.trigger.android.ui.main.KMainActivity2}: android.view.InflateException: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Error inflating class com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.view.InflateException: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Error inflating class com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
Caused by: android.view.InflateException: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Error inflating class com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:695)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:174)
at watch.trigger.android.ui.main.KMainActivity2.onCreate(KMainActivity2.kt:37)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
2020-06-21 13:12:19.056 10301-10301/watch.trigger.android E/AndroidRuntime: Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:217)
at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:145)
at com.google.android.material.internal.ThemeEnforcement.obtainStyledAttributes(ThemeEnforcement.java:76)
at com.google.android.material.button.MaterialButton.<init>(MaterialButton.java:203)
at com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.<init>(ExtendedFloatingActionButton.java:144)
at com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.<init>(ExtendedFloatingActionButton.java:138)
... 28 more
2020-06-21 13:12:19.119 10301-10301/watch.trigger.android E/UncaughtException: java.lang.RuntimeException: Unable to start activity ComponentInfo{watch.trigger.android/watch.trigger.android.ui.main.KMainActivity2}: android.view.InflateException: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Error inflating class com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.view.InflateException: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Error inflating class com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
Caused by: android.view.InflateException: Binary XML file line #84 in watch.trigger.android:layout/activity_kmain2: Error inflating class com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:695)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:174)
at watch.trigger.android.ui.main.KMainActivity2.onCreate(KMainActivity2.kt:37)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
2020-06-21 13:12:19.119 10301-10301/watch.trigger.android E/UncaughtException: Caused by: java.lang.IllegalArgumentException: The style on this component requires your app theme to be Theme.MaterialComponents (or a descendant).
at com.google.android.material.internal.ThemeEnforcement.checkTheme(ThemeEnforcement.java:243)
at com.google.android.material.internal.ThemeEnforcement.checkMaterialTheme(ThemeEnforcement.java:217)
at com.google.android.material.internal.ThemeEnforcement.checkCompatibleTheme(ThemeEnforcement.java:145)
at com.google.android.material.internal.ThemeEnforcement.obtainStyledAttributes(ThemeEnforcement.java:76)
at com.google.android.material.button.MaterialButton.<init>(MaterialButton.java:203)
at com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.<init>(ExtendedFloatingActionButton.java:144)
at com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton.<init>(ExtendedFloatingActionButton.java:138)
... 28 more

i am facing below error when trying to run the app that "App is keep stopping" how to resolve this?

'''2020-06-21 13:22:53.293 9305-9305/? E/le.androideati: Unknown bits set in runtime_flags: 0x8000
2020-06-21 13:22:54.521 9305-9305/com.example.androideatit E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.androideatit, PID: 9305
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.androideatit/com.example.androideatit.MainActivity}: android.view.InflateException: Binary XML file line #40 in com.example.androideatit:layout/activity_main: Binary XML file line #40 in com.example.androideatit:layout/activity_main: Error inflating class info.hoang8f.widget.FButton
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: android.view.InflateException: Binary XML file line #40 in com.example.androideatit:layout/activity_main: Binary XML file line #40 in com.example.androideatit:layout/activity_main: Error inflating class info.hoang8f.widget.FButton
Caused by: android.view.InflateException: Binary XML file line #40 in com.example.androideatit:layout/activity_main: Error inflating class info.hoang8f.widget.FButton
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:854)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1006)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:961)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1123)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1084)
at android.view.LayoutInflater.inflate(LayoutInflater.java:682)
at android.view.LayoutInflater.inflate(LayoutInflater.java:534)
at android.view.LayoutInflater.inflate(LayoutInflater.java:481)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.example.androideatit.MainActivity.onCreate(MainActivity.java:18)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 1 to color: type=0x5 // error is here
at android.content.res.TypedArray.getColor(TypedArray.java:532)
at info.hoang8f.widget.FButton.parseAttrs(FButton.java:116)
2020-06-21 13:22:54.522 9305-9305/com.example.androideatit E/AndroidRuntime: at info.hoang8f.widget.FButton.(FButton.java:52)
... 28 more
'''
the error is here
android.view.InflateException: Binary XML file line #40 in
com.example.androideatit:layout/activity_main: Binary XML file line #40 in
com.example.androideatit:layout/activity_main: Error inflating class
info.hoang8f.widget.FButton
In the resource file loaded by MainActivity, i.e. layout/activity_main at the line 40 there is a component, info.hoang8f.widget.FButton that surely are missing libraries declared in you gradle.build file, something like
implememntation 'info.hoang8f.widget.FButton:FButton:1.0.0'
or something like that

Categories

Resources