Hello, I have this problem in all my projects in android studio and I tried with "clear project" and with Tools" -> "Android" -> "Sync Project with Gradle Files". And the problem continues, what other solution could you suggest me for favour.
android.gradle(module)
android {
compileSdkVersion 21
buildToolsVersion '21.1.2'
defaultConfig {
applicationId "com.example.diego.tpfinal"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
android.gradle(project)
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the [![Consola de android studio][1]][1]individual module build.gradle files
}
Updated---- build.gradle(module)
Solution: I fixed my problem with the following video and with Elena's comments previously. https://www.youtube.com/watch?v=pw4jKsOU7go
The problem of not being able to generate the class
R.java
is generally due to an error in the resources.Check any red x that indicates a problem or check in the messages.
Try a
Clean Project
>Build
, if this doesn't fix it, it will surely show what the problem is.update:
You have to check that you have API 23 installed, you verify that in the Android SDK Manager.
and make sure inside your build.gradle that you have the version you downloaded