gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 18:30:17 27 4
gpt4 key购买 nike

我在扩充协调器布局时遇到问题。这是大部分的 logcat(如果您需要查看更多,请告诉我)

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)

我的 build.gradle 文件中有这个:

implementation 'com.google.android.material:material:1.0.0'

是否需要向我的 build.gradle 添加任何其他内容才能使用协调器布局?

最佳答案

将其添加到您的依赖项中:

implementation 'androidx.coordinatorlayout:coordinatorlayout:1.0.0'

关于android - 膨胀类 androidx.constraintlayout.widget.CoordinatorLayout 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56620593/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com