Following classes not found: android.support.v4.widget.DrawerLayout

白昼怎懂夜的黑 提交于 2020-01-04 04:12:15

问题


I was working on a project in Android Studio in which I had to use a navigation drawer, everything was running well. Recently Android Studio updated to 1.2 version and suddenly the activity where the the nav drawer was stopped rendering giving me that error.

I know that it is a known error and it happened to me before, but this time I can´t get it fixed.

The dependencies are set like this:

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:support-v4:22.1.0'
compile 'com.android.support:appcompat-v7:22.1.0'
compile 'com.google.android.gms:play-services:7.0.0'
}

So I think they are up to date and are not the problem. If I create another project with a navigation drawer it does not give that error though.

Thanks in advance!

EDIT:

An update for Android Studio has been released yesterday that in theory resolves layout rendering problems. Installed it, Gradle version updated and sync and the problem continues!! Im so upset right now, I can´t even create a new blank nav drawer activity, it says it can´t find it and won't render.


回答1:


I'm answering myself because it's been a long time since the question and seems that nobody had this problem. There was no solution for this, strangely Android Studio changed in some way and the exactly same code written in one file that wasn´t working works perfectly in another, so I had to rewrite the entire program in a new project and the problem is gone now. There was simply no answer of why after the update it couldn´t read the classes properly in that project so I had to delete it, thanks anyway!!



来源:https://stackoverflow.com/questions/30181260/following-classes-not-found-android-support-v4-widget-drawerlayout

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!