当我在Lollipop之前的设备上启动我的应用程序时,我收到此错误并且应用程序崩溃(在Lollipop上该应用程序正常工作):
NoSuchMethodError: android.support.v4.view.ViewCompat.isAttachedToWindow
在我的布局中,我使用:
DrawerLayout
(android.support.v4.widget.DrawerLayout
)
Toolbar
(android.support.v7.widget.Toolbar
)
ViewPager
(android.support.v4.view.ViewPager
)
PagerTabStrip
(android.support.v4.view.PagerTabStrip
)
FloatingActionButton
(android.support.design.widget.FloatingActionButton
)。
在build.gradle(Module:app)文件中,我有: 依赖性{
compile ('com.android.support:cardview-v7:22.2.0') {
exclude module: 'support-v4' }
compile ('com.android.support:recyclerview-v7:22.2.0') {
exclude module: 'support-v4' }
compile ('com.android.support:design:22.2.0') {
exclude module: 'support-v4' }
compile ('com.android.support:support-v4:22.1.1')
...
在Project窗口中,我可以看到以下外部库: https://drive.google.com/file/d/0B7p0FSMdyvwAdGwyNmVha2M0SWs/view?usp=sharing