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?
source share