膨胀类androidx.constraintlayout.widget.CoordinatorLayout时出错

时间:2019-06-16 16:14:02

标签: android android-coordinatorlayout

我在调整协调器布局时遇到麻烦。这是大多数logcat(让我知道是否需要查看更多信息)

#include "nuklear_sdl_gl3.h"

我的build.gradle文件中有此文件:

2019-06-17 00:06:50.530 19494-19494/com.vitrixhealth.datacollection E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.vitrixhealth.datacollection, PID: 19494
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.vitrixhealth.datacollection/com.vitrixhealth.datacollection.ui.patients.PatientsActivity}: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.constraintlayout.widget.CoordinatorLayout
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2884)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2963)
    at android.app.ActivityThread.-wrap11(Unknown Source:0)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1655)
    at android.os.Handler.dispatchMessage(Handler.java:105)
    at android.os.Looper.loop(Looper.java:164)
    at android.app.ActivityThread.main(ActivityThread.java:6665)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:772)
 Caused by: android.view.InflateException: Binary XML file line #2: Binary XML file line #2: Error inflating class androidx.constraintlayout.widget.CoordinatorLayout
 Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class androidx.constraintlayout.widget.CoordinatorLayout
 Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.constraintlayout.widget.CoordinatorLayout" on path: DexPathList[[zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/base.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_dependencies_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_resources_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_0_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_1_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_2_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_3_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_4_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_5_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_6_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_7_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_8_apk.apk", zip file "/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.vitrixhealth.datacollection-U3yD_XQl1CDFy1VwoToeOQ==/lib/arm64, /system/lib64, /system/vendor/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    at android.view.LayoutInflater.createView(LayoutInflater.java:606)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
    at com.vitrixhealth.datacollection.ui.patients.patientslist.PatientsListFragment.onCreateView(PatientsListFragment.kt:43)
    at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2595)
    at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:880)
    at androidx.fragment.app.FragmentManagerImpl.addAddedFragments(FragmentManagerImpl.java:2096)
    at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1870)

我还需要添加其他内容以使用协调器布局吗?

1 个答案:

答案 0 :(得分:1)

将此添加到您的依赖项中

<div *ngIf="data$ | async as data">
  <!-- Render your 'data' -->
</div>