Cannot Resolve Symbol 'Theme' in Styles.Xml (Android Studio)

Android Studio 3.0 cannot resolve symbol Theme

Another possible reason is: Google's maven repository is not set for the build script.

Open your project's main build.gradle add this line:

buildscript {
repositories {
google() <-- this
// Be also sure that google() is before jcenter()
}
}

Without this, it may not be able to download the Android Studio Gradle plugin 3.0+. It's not distributed in jCenter but in the Google's maven repository.

What wrong with my Style? cannot resolve symbol Theme.AppCompat.Light.NoActionBar

Finally, here is my first solution. The error happen because gradle not work with the libraries which has lower version. It doesn't compile the external library appcompat-v7:23.3.0. What I do now is downgrade gradle plugin frorm 2.+ to 2.2.0 and rebuild project. It works again now.

This link show how to downgrade version gradle [Link].

It is not a good idea, thought, but It did saved my problem.

Any other ideas or comments to improve, welcome.

Cannot resolve symbol 'Theme.AppCompat.Light.DarkActionBar' in styles.xml

Your build.gradle version is simply the wrong one.

Follow these instructions to fix that:

  • In Android studio, go to the Gradle scripts section in the left panel.
  • Find the file: build.gradle(Project:{your_project_name})
  • In that file look at the line com.android.tools.build:gradle
  • Check that the version match with your android studio version (for instance 2.3.3). This implies that com.android.tools.build:gradle:2.3.3 and And an Android studio distribution with 2.3.3 as version.
  • Validate the versions are the same. If it's not the case, make sure they match.
  • Rebuild the project and everything is fine!

Several android attributes not resolved in styles.xml

I think you could try the following solution:

  • Back up project
  • Delete the .idea folder and .iml files
  • Relaunch Android Studio and re-import the project.

For some people it will work to just remove all the libraries from .idea folder and re-sync Gradle.

If none of these are working you always could reinstall the complete studio which, depending on your network speed, wouldn't take that long.

Android Studio: Unresolved symbol Theme in styles.xml

Did you try to update the compileSDK Version? According to this post the reason can be both in the compileSDK or that the library is out of sync, or even you have to cancel .idea, or the google repository that is not set.



Related Topics



Leave a reply



Submit