Kareem Elsayed
Kareem Elsayed

Reputation: 295

R cannot be resolved to symbol

Every time i change minSDKVersion from build.grade from 8 to 9 i get that R error

I checked every single solution been mentioned here

"cannot resolve symbol R" in Android Studio

without fixing it

beside I cant keep minSDKVersion to 8 as many things just don`t work with 8

my gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
    applicationId "com.kareem.droid1"
    minSdkVersion 9
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
productFlavors {
}
}

dependencies {
compile 'com.google.android.gms:play-services-ads:7.3.0'
}

how to solve it ?

thanks for help

Upvotes: 2

Views: 122

Answers (2)

Gueorgui Obregon
Gueorgui Obregon

Reputation: 5087

I create new project from scratch with your configuration and everything works fine. I just have another two dependencies in my build.gradle

 compile 'com.android.support:appcompat-v7:22.2.1' 
 compile 'com.android.support:design:22.2.1'

EDIT: I removed 'com.android.support:design:22.2.1' and still works fine..

Please check your project dependencies

Hope its helps!!

Upvotes: 1

Maksim Novikov
Maksim Novikov

Reputation: 834

clean you project after yoy change build.gradle file

Build>clean project

should help.

Upvotes: 0

Related Questions