Open hlzIrving opened 5 years ago
整个布局加载只有TintButton出错了?那可能需要你debug看下TintButton初始化时具体发生的错误了
整个布局加载只有TintButton出错了?那可能需要你debug看下TintButton初始化时具体发生的错误了
我把依赖删除,使用库的形式添加magicasakura,在TintButton内打断点,也是在4.4.2夜神模拟器运行,竟然没有崩溃,成功跑起来了。所以,这到底是啥原因崩溃的。
😂那通过依赖的形式打断点看看呢
joy那通过依赖的形式打断点看看呢
Caused by: java.lang.NoClassDefFoundError: android.support.v4.graphics.drawable.DrawableWrapper
at com.bilibili.magicasakura.utils.ThemeUtils.getWrapperDrawable(ThemeUtils.java:270)
at com.bilibili.magicasakura.utils.ThemeUtils.containsNinePatch(ThemeUtils.java:245)
at com.bilibili.magicasakura.widgets.AppCompatBackgroundHelper.recoverPadding(AppCompatBackgroundHelper.java:197)
at com.bilibili.magicasakura.widgets.AppCompatBackgroundHelper.setBackgroundDrawable(AppCompatBackgroundHelper.java:122)
at com.bilibili.magicasakura.widgets.AppCompatBackgroundHelper.loadFromAttribute(AppCompatBackgroundHelper.java:65)
at com.bilibili.magicasakura.widgets.TintButton.
😯这个类是v4里的。。。感觉是模拟器的锅
布局: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context=".MainActivity">
错误:Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class com.bilibili.magicasakura.widgets.TintButton
我添加了依赖implementation 'com.bilibili:magicasakura:0.1.8@aar' 内部的属性也没错,所以不太清楚为啥会报这个错误,本人用的是4.4.2夜神模拟器跑的