1,【Android】Error: Expected resource of type styleable [ResourceType]
解決辦法 解決辦法就是在使用 TypedArray 的方法處,加上 @SupPRessWarnings(“ResourceType”) ,這樣即可過濾該警告,可以正常通過簽名編譯。例如:
@SuppressWarnings("ResourceType")public void initView() { TypedArray ta = mContext.obtainStyledAttributes(attrs); boolean hasBottomLine = ta.getBoolean(0, false); boolean hasTopLine = ta.getBoolean(1, false); ta.recycle();}2,Error:(3) Error: “app_name” is not translated in “de” (German), “es” (Spanish), “fr” (French), “hu” (Hungarian), “ja” (Japanese), “ko” (Korean) [MissingTranslation]
解決辦法 在出錯的資源文件 標簽里面添加屬性 xmlns:tools=”http://schemas.android.com/tools” tools:ignore=”MissingTranslation” 例如
<resources xmlns:tools="http://schemas.android.com/tools" tools:ignore="MissingTranslation"> <string name="app_name"></string> <string name="action_settings">Settings</string> <string name="hello_world">Hello world!</string> <item name="tag_id" type="id"></item></resources>新聞熱點
疑難解答