0
在Android Studio中出現以下錯誤。Android Studio:無法找到符號變量navigation_icon_list
錯誤:無法找到符號變量navigation_icon_list
這裏是它的談論
// icon list
TypedArray iconTypedArray = getResources().obtainTypedArray(R.array.navigation_icon_list);
Integer[] icons = new Integer[iconTypedArray.length()];
for(int i=0; i<iconTypedArray.length(); i++)
{
icons[i] = iconTypedArray.getResourceId(i, -1);
}
iconTypedArray.recycle();
我在另一計算器疑問,他通過移除import [appname].R;
解決它讀取。我嘗試過,但沒有奏效。
任何幫助,將不勝感激。
否導入代碼不是紅色。我正在使用Android Studio 1.4,Gradle 2.2.1和Android Plugins是1.3.0。 – m0nsta
要驗證的另一件事是XML文件包含在您的srcSets中,並且您的XML全部構建正確。 http://developer.android.com/guide/topics/resources/more-resources.html#TypedArray事實上,appname.R類存在並且缺少值表示您的arrays.XML文件未包含在合併中/進程資源任務。 – TrevJonez