簡體   English   中英

Android Studio 說在項目或庫中找不到“androidx.drawerlayout.widget.DrawerLayout”,即使我已經將它添加到 gradle

[英]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"> `

嘗試執行以下任何一種方法:

  • 轉到 File -> Close Project 關閉 android 項目。 然后再次導入
  • 如果上述選項對您不起作用,則 Go 到文件 -> 使緩存無效/重新啟動

如果它們都不起作用,請刪除依賴項並再次添加它,並在 gradle 同步完成時告訴我構建 output

您的工作室緩存可能已損壞;

所以

  • 首先關閉您的所有項目; 然后
  • C:\ Drive 中打開您的工作室路徑; 例如。 它應該像C:\Users\hp(Your_User_Name)\.AndroidStudio4.0\system\caches ... 刪除這個caches文件夾。

現在重新開始你的項目,問題現在就消失了。

希望這可能對某人有所幫助。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM