標籤:
咳咳,還是那句話,真是日了狗了
這個問題真的很難找,廢話不多少,上酸菜。
報錯資訊是這個方法返回的圖片找不到
public static int getImgID(boolean isBig, int id) { if (id == -2) return R.mipmap.tianjia; if (id == -1) return R.mipmap.jiahao; if (isBig) { switch (id) { case 0: return R.mipmap.jrfu; case 1: return R.mipmap.meishi; case 2: return R.mipmap.shenghuo; case 3: return R.mipmap.yule; case 4: return R.mipmap.dying; case 5: return R.mipmap.chuxing; case 6: return R.mipmap.jingdian; case 7: return R.mipmap.gouwu; case 8: return R.mipmap.jiudian; case 9: return R.mipmap.zhiyuan; case 10: return R.mipmap.xsyl; case 11: return R.mipmap.jrfu; } return R.mipmap.guanggao; } else { switch (id) { case 0: return R.mipmap.jrfw; case 1: return R.mipmap.ms; case 2: return R.mipmap.shfw; case 3: return R.mipmap.yl; case 4: return R.mipmap.dy; case 5: return R.mipmap.cx; case 6: return R.mipmap.jingdian_xiao; case 7: return R.mipmap.gw; case 8: return R.mipmap.jd; case 9: return R.mipmap.zyhn_xiao; case 10: return R.mipmap.xsyl_xiao; case 11: return R.mipmap.jrfw; } return R.mipmap.logo; } }
問題來了,運行代碼是OK的。
然後天空一聲巨響,醍醐灌頂。代碼寫的不規範,沒有用break,編譯有問題,才會報錯的。
安卓奇葩問題之:運行OK,打包安裝崩潰(原因是:代碼不規範導致編譯出錯)