Я пытаюсь реализовать приложение из онлайн-учебника на YouTube. Acitivity_main. xml не показывает MaterialSearchBar в режиме разработки и имеет следующее предупреждение:
activity_mail. xml предупреждение , а текст подробностей следующий:
java.lang.NullPointerException at android.content.res.BridgeTypedArray.resolveEnumAttribute(BridgeTypedArray.java:934) at
android.content.res.BridgeTypedArray.getString(BridgeTypedArray.java:215)
at android.content.res.BridgeTypedArray.getInt(BridgeTypedArray.java:244) at
androidx.constraintlayout.widget.ConstraintLayout$LayoutParams.(ConstraintLayout.java:2786) at
androidx.constraintlayout.widget.ConstraintLayout.generateLayoutParams(ConstraintLayout.java:1972) at
androidx.constraintlayout.widget.ConstraintLayout.generateLayoutParams(ConstraintLayout.java:482) at
android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:865) at
android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at
android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866) at
android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at
android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:394) at android.view.BridgeInflater.inflate(BridgeInflater.java:384) at android.view.View.inflate(View.java:24354) at
com.mancj.materialsearchbar.MaterialSearchBar.init(MaterialSearchBar.java:128) at com.mancj.materialsearchbar.MaterialSearchBar.(MaterialSearchBar.java:113) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at
java.lang.reflect.Constructor.newInstance(Constructor.java:423) at
org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:403) at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:186) at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:144) at
com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:309) at
android.view.BridgeInflater.loadCustomView(BridgeInflater.java:418) at
android.view.BridgeInflater.loadCustomView(BridgeInflater.java:429) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:333) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at
android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at
android.view.LayoutInflater.inflate(LayoutInflater.java:515) at
android.view.LayoutInflater.inflate(LayoutInflater.java:394) at
com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:323) at
com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:394) at
com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:200) at
com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:572) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$5(RenderTask.java:698) at
java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Вот код xml: activity_main. xml. В режиме конструктора MaterialSearchBar не
, показывающий / отображающий результат Может ли кто-нибудь помочь решить эту проблему, например, как исправить предупреждения, показать MaterialSearchBar в режиме разработки и, наконец, запустить приложение. Заранее спасибо!