引入第三方jar或者library时比如自定义控件。突然报如下错误:

07-17 09:22:25.430: E/CrashHandler(14102): Caused by: android.view.InflateException: Binary XML file line7 

07-17 09:31:23.725: E/CrashHandler(14538): Caused by: java.lang.NoClassDefFoundError: R$styleable

07-17

主要就是定位到这行代码有问题:

context.obtainStyledAttributes(attrs, R.styleable.YView);

这是由于adt高于21后由于添加了如下:

Android android.support.v7.appcompat.R$styleable

 解决办法:

升级你的adt到22以上sdk版本4.2后

在buildpath中修改如下:

Android android.support.v7.appcompat.R$styleable

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-03
  • 2021-11-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-04-16
  • 2021-10-29
  • 2021-08-29
相关资源
相似解决方案