[英]android.widget.RelativeLayout cannot be cast to androidx.drawerlayout.widget.DrawerLayout
[英]Android Studio says "androidx.drawerlayout.widget.DrawerLayout" was not found in the project or libraries, even though I already add it in the gradle
[在此處輸入圖片描述][1]
[1]: https://i.stack.imgur.com/A8LGg.png` <androidx.drawerlayout.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns :app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/drawer_layout" android: layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" 工具:openDrawer="start"> `
嘗試執行以下任何一種方法:
如果它們都不起作用,請刪除依賴項並再次添加它,並在 gradle 同步完成時告訴我構建 output
您的工作室緩存可能已損壞;
所以
C:\
Drive 中打開您的工作室路徑; 例如。 它應該像C:\Users\hp(Your_User_Name)\.AndroidStudio4.0\system\caches
... 刪除這個caches
文件夾。現在重新開始你的項目,問題現在就消失了。
希望這可能對某人有所幫助。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.