-3

First of all sorry for any fustration, im a newbie at coding for android. I came home trying to carry on with my application (which worked fine the last I tested it) and I got this error when I opened up android studio:

Cannot resolve symbol R

This occured on every activity, as they all contained R when I made a new activity. Ive tried to rebuild and clean build - both of those come up with the following error:

No resource found that matches the given name (at 'enabled' with value '@bool/use_provider').

Along with: Error:Execution failed for task ':mobile:processDebugResources'.

com.android.ide.common.process.ProcessException: Failed to execute aapt

Im genuinely confused as to why these errors have turned up out of nowhere. Any help is greatly appreciated as I have until friday (21/04) to complete my application, near impossible currently as I am unable to test it

EDIT

I was snooping around in the build.gradle for the wear device, (as my application makes use of both wear and mobile), and the following dependencies code was highlighted as broken:

compile 'com.google.android.support:wearable:2.0.0'

and

compile 'com.android.support.constraint:constraint-layout:1.0.2'

The first line said the following when highlighted:

Project depends on com.google.android.support:wearable:2.0.0, so it must also depend (as a provided dependency) on com.google.android.wearable:wearable:2.0.0

The second line said this:

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.3.0, 24.0.0, 23.0.1. Examples include com.android.support:support-compat:25.3.0 and com.android.support:support-v4:24.0.0

Again, any help would be appreciated

  • 2
    Possible duplicate of ["cannot resolve symbol R" in Android Studio](http://stackoverflow.com/questions/17054000/cannot-resolve-symbol-r-in-android-studio) or [R cannot be resolved - Android error](http://stackoverflow.com/questions/885009/r-cannot-be-resolved-android-error) or [R cannot be resolved to a variable](http://stackoverflow.com/questions/7824730/r-cannot-be-resolved-to-a-variable) or many others. – takendarkk Apr 19 '17 at 18:45
  • Just Clean your project Build > Clean Or Rebuild – Mouad Abdelghafour AitAli Apr 19 '17 at 19:27
  • I tried doing that if you read what I wrote, both of those methods were unsuccessful – Max Reid-Williams Apr 19 '17 at 19:31

1 Answers1

0

Install the latest version of the build tools. Adjust your build.gradle to use

android {
`compileSdkVersion` {X}
`buildToolsVersion` {X.Y.Z}
 ...

}

Aamir
  • 101
  • 1
  • 12