Ashish Parab
Ashish Parab

Reputation: 172

R cannot be resolved in Android

While trying to execute simple Hello world program i am getting this error as "R cannot be resolved".

in java activity file R is appearing in red. when i put mouse pointer on it it says "Cannot resolve symbol R".

when I tried to trace an error, it turned out to be in v23\values-23.xml

it says

C:\Users\m\AndroidStudioProjects\myApp\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.0.0\res\values-v23\values-v23.xml

Error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.

Error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

Error:Execution failed for task ':app:processDebugResources'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Users\m\AppData\Local\Android\sdk\build-tools\23.0.0\aapt.exe'' finished with non-zero exit value 1

Upvotes: 0

Views: 561

Answers (2)

gavr1loo
gavr1loo

Reputation: 1

This worked for me. Update SDK and then try.

Upvotes: -1

Banana droid
Banana droid

Reputation: 690

Please check your build.gradle file

compileSdkVersion 23
buildToolsVersion "23.0.0"
targetSdkVersion 23

After that, please sync gradle by Ctrl + Alt + Y.

If you still having trouble, please comment.

Upvotes: 2

Related Questions