2014-02-16 64 views
0

當我試圖重構一個應用程序,我得到數百名「在包com.app」「No resource identifier found for (...)」錯誤沒有資源標識符發現

我怎樣才能解決這個問題?

我已經嘗試將值替換爲新的包名,但錯誤仍然相同。

的錯誤發生在這樣的代碼部分:

<com.example.app 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:latin="http://schemas.android.com/apk/res/com.fa.ime" 
    android:id="@+id/LatinkeyboardBaseView" 
    android:layout_alignParentBottom="true" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:paddingBottom="@dimen/keyboard_bottom_padding" 
    android:background="@drawable/keyboard_dark_background" 
    android:textStyle="bold" 

    latin:keyBackground="@drawable/btn_keyboard_key_gingerbread" 
    latin:keyTextStyle="bold" 
    /> 
+0

你重構了什麼? –

+0

程序包名稱(com.example.app) –

回答

0

R類別,用於訪問資源在機器人,連接到來自Android.manifest使用包名稱。在所有進口的R類舊包名中替換新的包名。不幸的是,您只能在這種情況下使用標準文本搜索。

據我所知,只有這個類使用來自清單的包名稱,所以其他進口應該沒問題。

我不使用Android支持包,但是如果您使用它,則在與活動關聯的每個佈局中,都可以包含參數tools:context,其中包含對活動的引用。如果您更改了應用的軟件包名稱,這也可能成爲您問題的根源。

+0

是的,這是我通常在Android代碼中執行的操作。但是正常的佈局文件呢? –

相關問題