Caused by: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.wid

第一次出现这个问题是把Androidstudio项目转化为eclipse时,用eclipse编译的apk运行时可能会报这个错误,引入appcompat_v7资源文件时,可以解决这个错误。另外就是从Androidstudio转化过来的项目引用资源都是通过R.mipmap.xxx而eclipse中用的是R.drawable.xxx。把项目中使用了R.mipmap.xxx的地方全部改为R.drawable.xxx也可以避免这个报错。而我出现这个错误的原因可能是因为项目移植过来之后这两个引用都有使用。

转载于:https://my.oschina.net/riverpz/blog/852454

你可能感兴趣的:(Caused by: java.lang.ClassCastException: android.widget.RelativeLayout cannot be cast to android.wid)