android.view.InflateException: Binary XML file line #0: Binary XML file line

这个问题,网上还是比较常见的,能搜到的,一般是引用错误造成的,比如相同名称的LinearLayout ListView,我比较碰到这个错误,是写分割线的时候写成了小写的,这些都很好改

 

接下来这个就比较模糊了,一样是报这个错误,但是包名,类名都写对了,我碰到的是天地图控件。是因为权限没赋予,可能它内部有用到Sd卡的读取写入,在使用地图之前加入权限就行了,我用的EasyPermissions:

String[] permissions = new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.RECORD_AUDIO,
        Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.ACCESS_COARSE_LOCATION,
        Manifest.permission.ACCESS_LOCATION_EXTRA_COMMANDS, Manifest.permission.ACCESS_FINE_LOCATION};

if(!EasyPermissions.hasPermissions(this, permissions)) {
    EasyPermissions.requestPermissions(this, "需要权限定位显示地图,上传日志",
            1023, permissions);
}

 

你可能感兴趣的:(Android)