2017-05-26 45 views
-1

我面臨這個問題,並從很長一段時間搜索這個沒有工作,我會很高興,如果任何人可以幫助我。沒有在屬性中找到屬性「id」的資源標識符

enter code here 

<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    xmlns:andriod="http://schemas.android.com/apk/res-auto" 
    xmlns:app="http://schemas.android.com/apk/res-auto" 
    tools:context='com.chat_app.android.ui.activities.LoginActivity'> 
<item 
    android:title="@string/action_logout" 
    andriod:id="@+id/action_logout" 
    android:orderInCategory="100" 
    app:showAsAction="never" 
    /> 
</menu> 
+0

你檢查這HTTPS:??//www.google.co.in/search Q =否%20Resource%20identifier%20found%20for%20attribute 20% %27id%27%20in%20pakage&ie = utf-8&oe = utf-8&client = firefox-b&gfe_rd = cr&ei = uW0oWcvnC-fs8AeyvLC4DQ#q =沒有+資源+標識符+找到了+屬性+%27id%27 + in包 – banguru

回答

0

請檢查下面的代碼:

<?xml version="1.0" encoding="utf-8"?> 
<menu xmlns:android="http://schemas.android.com/apk/res/android" 
     xmlns:app="http://schemas.android.com/apk/res-auto"> 

    <item 
     android:title="@string/action_logout" 
     android:id="@+id/action_logout" 
     android:orderInCategory="100" 
     app:showAsAction="never" /> 

</menu> 
0

的問題是,你的android拼錯:

andriod:id="@+id/action_logout" 

Android Studio中試圖通過加入xmlns:andriod="http://schemas.android.com/apk/res-auto"來解決這個問題,但id屬性不會在你的應用程序中聲明(這就是res-auto拉從)。

您應該修復拼寫錯誤,然後刪除xmlns:andriod部分。

+0

你先生:D愚蠢的錯誤:第 –

相關問題