Home > Back-end >  How to fix errors android.annotation. in Handler.java?
How to fix errors android.annotation. in Handler.java?

Time:01-18

This is what is constantly in the log, when I try to run my application on Android lolipop 5. On later versions of android it runs without any problems.

It refers to Handler.java and other files, which are all in error by default.

Even reinstalling the program and SDK from scratch didn't help.

How to solve this problem? I even tried rewriting Import under Androidx, doesn't help.

Handler.java Handler.java (2)

at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698) Caused by: android.view.InflateException: Binary XML file line #10: Error inflating class android.widget.ScrollView at android.view.LayoutInflater.createView(LayoutInflater.java:633) at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:55) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:682) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.inflate(LayoutInflater.java:482) at android.view.LayoutInflater.inflate(LayoutInflater.java:414) at android.view.LayoutInflater.inflate(LayoutInflater.java:365) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:775) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:197)

I do not understand why Android Studio, installed by default, immediately comes with errors that need to be corrected

CodePudding user response:

The error has nothing to do with the handler class,

the error is

Binary XML file line #10: Error inflating class android.widget.ScrollView

It cannot inflate your layout so you should check it for errors

  • Related