這是錯誤日誌:機器人工作室打造.9.png格式錯誤
Error:Execution failed for task ':MobileSafe2:mergeDebugResources'.
Crunching Cruncher call_locate_blue.9.png failed, see logs
但是當我打開.9.png
擴展到.png
,錯誤就會消失,我不知道爲什麼會發生。
這是代碼:
public void myToast(String address) {
View view = View.inflate(context, R.layout.address_show, null);
view.setBackgroundResource(**R.drawable.call_locate_blue**);
TextView textView = (TextView) view.findViewById(R.id.tv_address);
textView.setText(address);
WindowManager.LayoutParams params = new WindowManager.LayoutParams();
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
params.width = WindowManager.LayoutParams.WRAP_CONTENT;
params.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE
| WindowManager.LayoutParams.FLAG_NOT_TOUCHABLE
| WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON;
params.format = PixelFormat.TRANSLUCENT;
params.type = WindowManager.LayoutParams.TYPE_TOAST;
wm.addView(view, params);
}
這是Android Studio中
錯誤信息來源:
我已經得到解決 '.9.png' 變成」。 PNG',那麼它可以工作,但圖片將被扭曲
什麼是您的android構建工具版本?你有沒有嘗試Build-> Clean? – agamov
你的9貼片是否形成良好?你能證明嗎? –
顯示你的9個補丁img snap –