After importing the demo from http://developer.android.com/training/implementing-navigation/nav-drawer.html, the android studio automatically makes it Gradle-configured .
At first, it's dependency part in build.gradle
:
dependencies {
compile 'com.android.support:+'
}
And the above causes error.
Followed the solution (Manifest merger failed : uses-sdk:minSdkVersion 14), I change it to
dependencies {
compile 'com.android.support:support-v4:20.0.0'
}
and it works. Then I can build and run the app.
However, the code shows 'cannot resolve symbol R ‘, 'cannot resolve symbol DrawerLayout' and so on. And I then found errors in activity_main.xml
:
android.support.v4.widget.DrawerLayout could not be found
I have specify the dependency of android.support.v4
, and why the drawerlayout cannot be found?
Try this.
compile 'com.android.support:support-v4:21.0.3'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With