Android studio: android.support.v4.widget.DrawerLayout could not be found

After importing the demo version of http://developer.android.com/training/implementing-navigation/nav-drawer.html , Android Studio automatically makes it Gradle -configured . First, part of the dependency is in build.gradle :

 dependencies { compile 'com.android.support:+' } 

And that leads to an error.

The following solution ( Merge failed: use-sdk: minSdkVersion 14 ), I change it to

 dependencies { compile 'com.android.support:support-v4:20.0.0' } 

and it works. Then I can create and run the application.

However, the code shows that β€œit is impossible to resolve the R character,” β€œcannot resolve the DrawerLayout character,” etc. And then I found errors in activity_main.xml :

 android.support.v4.widget.DrawerLayout could not be found 

I am defining android.support.v4 dependency and why cannot drawerlayout be found?

+6
source share
1 answer

Try it.

compile 'com.android.support:support-v4:21.0.3'

+2
source

Source: https://habr.com/ru/post/976722/


All Articles