Remove ignored Android Studio update - android-studio

I have the 2.2.3 version of Android Studio on Ubuntu and I clicked "Ignore this update" by mistake. How can I apply the update without having to reinstall Android Studio?
I found the answer below, but I can't find the other.xml neither updates.xml files:
Removing Ignored Android Studio (or Intellij) Update Builds

In Linux go to ~/.AndroidStudio2.2/config/options folder and edit updates.xml.
Remove ignoredBuildNumbers block.
In my updates.xml file, it was like below. Removing this block solved it.
<ignoredBuildNumbers>
<item value="162.3764568" />
</ignoredBuildNumbers>

On my MacOS it was present on :
~/Library/Preferences/AndroidStudio2.2/options/updates.xml
And I removed the following lines
<ignoredBuildNumbers>
<item value="162.3764568" />
</ignoredBuildNumbers>

Related

Android Studio missing essential plugin org.jetbrains.android

I have just updated to Android Studio 4.1 Canary 9, but I am getting the following error:
Missing essential plugin:
org.jetbrains.android
Please reinstall Android Studio from scratch.
I've tried reinstalling Android Studio from scratch, as the error says, but nothing changes.
Just delete this file (or delete last disabled plugin(s) in this file):
C:\Users\%USERNAME%\.AndroidStudio<version>\config\disabled_plugins.txt
Update 10 Feb 2021:
If you couldn't find this address try this on windows:
C:\Users\%USERNAME%\AppData\Roaming\Google\AndroidStudio<version>\disabled_plugins.txt
Recently this Address transferred to here.
Update 04 August 2021:
If you are using windows 11
The App data folder is hidden and needs to be prompted(just search how to take out the missing app data folder in windows 11)
Then go to the same location as earlier mentioned and delete that file
On Mac OS
Open ~/Library/Application Support/Google/AndroidStudioXXXX.X
delete disabled_plugins.txt
restart Android Studio
For Windows users.
C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudioPreview4.1\disabled_plugins.txt
Deleting this file will fix the issue.
More detailed information.
As the Known Issues section of the Android Studio 4.1 Preview page notes, if you are getting this error in Android Studio 4.1 Canary 9, it means that you have a locally installed Kotlin plugin that is not compatible with the new IDE.
To resolve it, you should delete the Kotlin folder from the following locations (from the above linked page), depending on your operating system:
Linux: ~/.local/share/Google/AndroidStudioPreview4.1
Windows: C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudioPreview4.1
macOS: ~/Library/Application Support/Google/AndroidStudioPreview4.1
For Linux and macOS, ~ refers to your home directory, and a directory can be removed from the command line (Terminal) with rm -rf directory_name_here.
There is no need to install a replacement Kotlin plugin, as it is bundled in that version of Android Studio.
On Linux (Fedora release 30), the issue happened after I wanted to disable Kotlin features during installation. I could resolve it by removing configure files:
rm -r ~/.config/Google/AndroidStudio4.1
Or just remove the disabled_plugins.txt file:
rm ~/.config/Google/AndroidStudio4.1/disabled_plugins.txt
Sometimes you are compelled to re-extract your android-studio on your Linux machine. Notice that removing ~/.local/share/Google/AndroidStudio4.1/ directory did not help me.
Disabling the Kotlin plugin for Android Studio 4.x causes this problem and you can't open the Android Studio until enable the Kotlin plugin again. To re-enable plugins without opening Android Studio, you can delete or edit the disabled_plugins.txt file from your Android Studio configuration path.
For Linux distros, the default configuration directory is ~/.config/Google/AndroidStudio4.x/
So deleting disabled_plugins.txt will enable all of your disabled plugins and solve your problem.
rm ~/.config/Google/AndroidStudio4.1/disabled_plugins.txt
For macOS, the default directory is ~/Library/Application Support/Google/AndroidStudio4.x
rm ~/Library/Application\ Support/Google/AndroidStudio4.1/disabled_plugins.txt
2022 - for MacOs Catalina:
Finder /
Users /
*your_username /
Library /
Application Support /
Google /
AndroidStudio20021+ /
disable_plugins.txt /
find and delete this line "org.jetbrains.kotlin"
or
delete the line causing your problem
On Linux, when disabling all plugins, this may happen (Artic Fox). The path is (or may be):
~/.config/Google/AndroidStudio2020.3/disabled_plugins.txt
Commenting out entries with a # is possible, in order to leave specific plugins disabled.
I'm using Linux Ubuntu 18.04 and Android Studio 4.0 and I found disabled_plugins.txt file in this directory:
/home/[your_username]/.AndroidStudio4.0/config
and after that I found I've put Kotlin plugin at the end of file.
Just remove that line, Android Studio will work.
By the way, on any other OS, you can find your file just by searching disabled_plugins.txt.
Library -> Application support -> Google -> AndroidStudio4.2 -> disabled_plugins.txt
For MAC Mojave
For MacOS BigSur
Root/Users/{your_user}/Library/Application Support/Google/AndroidStudio{version}/disabled_plugins.txt
Searching for the file won't work.
Gain access to root through Shift+cmd+g
Show hidden files using Shift+cmd+. (Library will most likely be hidden inside your user folder)
Got to C:Drive and delete disabled_plugins.txt file
C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudioVersion\disabled_plugins.txt
If you don't find watch this video
https://youtu.be/sMzAw6xaiZU that I made.
On Mac OS
in terminal helped to find bad files find ~/Library -name disabled_plugins.txt
in terminal run rm '/Users/xxxx/Library/Application Support/Google/AndroidStudio2021.2/disabled_plugins.txt'
Delete File
restart Android Studio
For Windows users
C:\Users\Admin[if you have username].AndroidStudio4.0\config
There you can find disabled _plugins.txt
delete it and restart android studio
It seems you disabled your plugins before, so find and edit
disabled_plugins.txt
and delete the plugin you want to enable it.
In windows, the location of file is :
C:\Users\<UserName>\AppData\Roaming\Google\AndroidStudio...
Removing these from disabled_plugins.txt fixes the issue if you have disabled some of the plugins. Instead of adding back all the plugins, specify the plugins to enable:
groovy, smali, kotlin, junit // (i.e: Enable these)
C:\Users\Dell\AppData\Roaming\Google\AndroidStudio4.1
and then delete >>>> disabled_plugin.txt
At the place of Dell, you can place your user name or device name(Example - Dell, Lenovo etc).
I'm using Android Studio 4.0 from homebrew.
And delete this
/Users/[your_name]/Library/Preferences/AndroidStudio4.0/disabled_plugin.txt
in macOS Catalina 10.15, this file can be found at
/Users/{your_user_name}/Library/Application Support/Google/AndroidStudio4.1/plugins
Delete disabled_plugins.txt this contains all disabled plugins
This issue happens because of two reasons.
You disabled some plugins from Android Studio and Restarted.
Some Plugins disabled by any thread and you starts getting missing essential plugin org.jetbrains.android this error message.
Solution is simple.
C:\Users\Numan\AppData\Roaming\Google\AndroidStudio4.1
Just go to the latest Android Studio Version, and find the text document file named as disabled_plugins. Now open it, and delete the lines which you think has been disabled, or otherwise delete the complete disabled_plugins file and open the Android Studio. You can also search disabled_plugins in your C Drive, and one text file will appear in case you're unable to locate it from AppData.
It Works - Cheers !!!
Error Reason: This issue occurs after disabling one or more plugin (example: Kotlin) from Android Studio 4.x settings (Android Studio -> Preferences —> Plugins —> Uncheck the Kotlin plugin -> Apply -> Ok —> Restart the Android Studio ==> ERROR prompt
Solution (Mac Specific): Remove the “disabled_plugins.txt” file
find ~/Library -name disabled_plugins.txt
Ideally, the path would be: /Users//Library/Preferences/AndroidStudio4.x/disabled_plugins.txt
rm disabled_plugins.txt
Restart the Android Studio
for Android Studio AndroidStudio2020.3 just remove this file:
disabled_plugins.txt
from this path:
C:\Users\YOUR_USERNAME\AppData\Roaming\Google\AndroidStudio2020.3
All answers related with disabled_plugins.txt is right, but it is enough to just delete the line (it is not necessary to delete this file. Thus, previously disabled plugins will remain disabled.)
only windows user
try this
it works for me
I am Deleting this file disabled_plugins.txt
C:\Users\ashif.AndroidStudio4.0\config
Solution is to delete disabled_plugins.txt.
On Linux, Android Studio 4.1 path is:
~/.config/JetBrains/AndroidStudio4.1
In mac os use Cmd+Shift+. to show hidden files and when find disabled_plugins.txt
For Android Studio 4.2+ this happens when you disable the Properties Pluggin or Groovy Plugin, you can remove these entries from the disabled_pluggins.txt. For Windows users the file is located at:
C:\Users\{username}\AppData\Roaming\Google\AndroidStudioPreview4.X\disabled_plugins.txt
Provide your username in the {username} field in the above address,
alternatively, you could just delete this file as the other answers mention!
If you are using JetBrains Tool Box to install just find the disabled_plugins.txt file on the path below: C:\Users[YOUR USERNAME]\AppData\Roaming\Google\AndroidStudio2021.1
On Linux with Android Studio 4.1
it was another path for me, maybe this is the new format now?
~/.config/Google/AndroidStudio4.1

Error initializing ADB: Debug Bridge not found

I want to work with some files in flutter and so I wanted to use the Android Studio Device File Explorer to check if everything works correctly.
But the Device File Explorer shows a red warning "Error initializing ADB: Android Debug Bridge not found"
On a "normal" Android Project with Java there is no Problem and everything is displayed correctly.
I reinstalled Android Studio, changed the AVD but nothing changed.
Is this a bug in Flutter or Android Studio?
Thanks for helping.
Ok, I solved the problem. You must go to your Project Structure, add a Project SDK to your project and reopen Android Studio. Then the Problem should be solved.
The error might occur when you create a Flutter app in VS Code instead of Android Studio. To fix it, simply add a misc.xml file in your .idea folder, with the following contents or similar:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_12" default="false" project-jdk-name="Android API 29 Platform" project-jdk-type="Android SDK" />
<component name="ProjectType">
<option name="id" value="io.flutter" />
</component>
</project>
You could also create a new Flutter project in Android Studio to view the contents of misc.xml as it might differ slightly.

How can I fix "Design editor is unavailable until a successful build" error?

I started to learn Android Studio. I try to echo out simple "Hello World":
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
android:id="#+id/activity_main"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:paddingBottom="16dp"
tools:context=".MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
</RelativeLayout>
but when I clicked "design" view, this error is showing?
Design editor is unavailable until a successful build
How can I fix this error.
I just noticed that my xml code is causing error. Is that why this may be not working?
Go to File > Sync Project with Gradles Files.
Quit the Android Studio ( not close the project Quit the Android Studio) then open the project and go to Android Studio > Build > Clean Project
Then
Android Studio > File > Sync Project with Gradles Files as the pic below
If your problem still exists then click the Install build tool as the pic below and then
Android Studio > File > Sync Project with Gradles Files
None of the above worked for me. what worked for me is to go to File -> Invalidate Caches / Restart
I faced same issue even after rebuilding my project multiple times successfully. I closed the project and re-opened, issue resolved.
First, find your build.gradle in your all modules in project, include app/build.gradle. Find the compileSdkVersion inside android tag, in this case, compile sdk version is 30:
Next, open SDK Manager > SDK Platforms, check for install SDK versions that there modules using, then apply to install selected platforms.
After installed, go to menu File > Sync project with Gradle files....
This issue often appear when project has many modules, each module use different compile SDK version, so app may be able to build but IDE have some issue while processing your resources.
Simply restart the Android Studio. In my case, I was offline before starting the Android Studio, but online when I did restart.
Do this
Build -> Rebuild Project
Install missing plataform and sync project
Go online before starting android studio. Then go file->New project
Follow onscreen steps. Then wait It will download the necessary files over internet. And that should fix it.
I got this problem after i added a line in my build.gradle file.
compile 'com.balysv:material-ripple:1.0.2'
Solution:
I changed this line to
implementation 'com.balysv:material-ripple:1.0.2'
and then pressed sync again.
Tada! all was working again.
In my case, it was because it didn't like that I left the minSDK and targeSdk in the manifest. Go figure.
just click file in your android studio
then click Sync Project with Gradle Files..
if it won't work,
click Build
click Clean Project.
it always work for me
The Android SDK Platform API Level that the project requires for targetSdkVersion may not exist.
Check the console of the Event Log tab of the IDE to see any errors eg. of the following type:
Gradle sync failed:
com.android.tools.idea.gradle.project.sync.idea.issues.SdkPlatformNotFoundException:
Module: 'common' platform 'android-29' not found.
Then install some API Level (29) in SDK Manager -> SDK Platforms and finally Sync again.
Edit you xml file in Notepad++ and build it again. It's work for me
I have the latest Android Studio 3.6.1 and yet couldn't build a simple 'Hello World' app as documented here "https://codelabs.developers.google.com/codelabs/android-training-hello-world/index.html?index=..%2F..%2Fandroid-training#3".
I applied various steps discussed above including the 2 most viable options which should have really solved this issue,
'File->Sync Project with Gradle Files' and
'File->Invalidate Caches/Restart' but to no avail.
Even though, I suspect standard answer should be one of these 2 options only for most, but for me the resolution came only after I went inside the 'File->Project Structure' and checked my SDK versions configured!
Android Studio and Gradle were using different JDK versions and locations.
Android Studio: C:\Program Files\Java\jdk1.8.0_241
Gradle: C:\Program Files\Java\jdk-13.0.2
I had previously defined my JAVA_HOME environment variable by downloading latest JAVA SDK on my own from ORACLE website. Where Gradle was using the %JAVA_HOME% JAVA SDK version and Android Studio the built in SDK which came along with Android Studio.
Once I switched both to versions JDK 1.8.* (Any version as long as it is JDK 1.8. for that matter*) then simple 'File->Synch...' option worked perfectly fine for me!
Good luck the solution is in between one of these 2 options only if you are stuck, just ensure you validate JDK versions being referred to!
there are different solutions to this problem but I at the first u have to check to (build.gradle) maybe it empty. this especially if u downloaded code, not u created
and u will find just this line "// Top-level build file where you can add configuration options common to all sub-projects/modules."
in this case, u need to open a new project and make copy-paste.then check the SDK and other settings.finally u have to sync
In my case, the Windows Firewall was blocking Android Studio (i.e. java.exe from Android Studio's jre/bin folder) from connecting to sites and downloading data. After Windows asked me if I wanted to allow the app through the firewall, I had to do a manual sync File -> Sync project with gradle files. After that, things were still disfunctional, a manual download of an SDK version 28 was necessary from Tools -> SDK Manager.
If you are in corporate setting where there is a proxy server, double check your proxy settings.
Go File -> Settings
Search for Proxy.
Fill out as appropreate.
Test connection.
If you think you fat-fingered the password, there is a Clear passwords button you can click to where you can re-enter your creds. HTH
I had tried to change SDK Version:
Check below image: In that I changed 27 from Android P

Error running android: Gradle project sync failed. Please fix your project and try again

Android Studio (1.2 RC0) keeps telling me
Error running android: Gradle project sync failed. Please fix your project and try again.
How can I find out what the problem is? Unfortunately the solutions from this SO thread did not help.
Goto File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio (It will download gradle metadata and data)
Gradle build succeed
Rebuild project. Done.
Solution is
Connect your computer to the internet
Click
Sync project with Gradle files
On toolbar
It will automatically sync the gradle.
Just ignore the error and try running the project anyway.
It will fail, but this time you will get a link in the error description. Clicking the link will trigger the automatic update/download of the outdated/missing component.
In my scenario, the project failed to launch two times, each time another API/SDK component being the culprit.
In my case I was just trying to launch a sample project I downloaded, having no clue what API level was being targeted or where to look for this information.
Download the latest Gradle package distribution for example (gradle-2.11-all.zip).
Extract this zip file in a folder as for example (D://Gradle)
Load your project in Android Studio and go to File->Settings->Gradle. Click on Use local Gradle distribution and point it to the folder where you unzipped the latest Gradle project.
Restart your project
It is a very common issue and the solution is very easy...
Just update the SDK in SDK manager(see full instructions below)
Open Android Studio and go to your SDK Manager(File>Settings>SDK
Manager)
Check for (-) icon in front of any package and click on it.
Click OK to start updating the SDK.
Thanks for asking that question :)
Delete "build" folder from project's root folder. Then do "invalidate cache and restart". This will restart your Android Studio and then build the app again, will solve the issue.
Go to
file->settings->build,execution,deployment->gradle.
(and set gradle home path from your directory)
If no error messages are shown: sometimes the command-line gradle shows them. Just go the the command-line, change to the app directory and type
gradle installDebug
or, if the details are missing
gradle --info installDebug
This can provide additional information how to debug the problem.
I had the same issue yesterday. After opening the "Android SDK Manager", updating all packages and restarting Android Studio, the project compiled again.
For me, the problem was the SDK Tools License had not been accepted. Clicking on the "Build" tab at the bottom uncovered the issue.
From there, I went into the AVD, uninstalled the tools and then reinstalled them, which prompted to accept the license.
All of these have not worked for me, what did is reading the very bottom of the log file located around here
C:\Users\madri\AppData\Local\Google\AndroidStudio2020.3\log\idea.log
and it said the following
So i fixed the problem by going into Tools > SDK Manager and installing the required SDK version
it looks different from one situation to another.
for me i did an installation and update a lot of things that the sdk manager said to then i had this problem.
all i did was:
from file -> Invalidate caches/Restart
(a dialog will pop-up) choose Invalidate and restart.
after the restart is done. everything was fixed but i needed to create a new emulator and delete the old one.
(android studio 1.3.1)
(one professional must edit this to be more understandable)
.
.
.
Here everything was fine, but your machines also needs restart because some system files are changed, to sync them we have to restart the system.
This could be due to Android Studio version conflict of v3 and v4 especially when you import a project in android stdio v4 which was previously built in v3.
Here are the few things you need to do:
remove the .gradle and .idea folders from the main Application folder.
import the project in the android studio.
after the sync finished, it will ask you to update the android studio supported version.
click update.
done.
I had the exact same error message
Error running android: Gradle project sync failed. Please fix your project and try again
Steps to solve:
Close Android Studio.
Remove the .gradle and .idea folders from the Application folder.
Open Android studio with your project.
After these steps android studio gradle will sync and download the required files to run the project (don't forget to disable offline mode).
I got this error going from Gradle 3.5.3 to 5.4.1 (Android Studio prompted and I clicked "Upgrade".)
Gradle proceeded to upgrade but yielded some errors such as:
ONFIGURE SUCCESSFUL in 1m 27s
ERROR: The Android Gradle plugin supports only Crashlytics Gradle plugin version 1.25.4 and higher.
The following dependencies do not satisfy the required version:
root project 'Android%20App' -> io.fabric.tools:gradle:1.25.1
Update plugins
Affected Modules: app
INFO: API 'variant.getExternalNativeBuildTasks()' is obsolete and has been replaced with 'variant.getExternalNativeBuildProviders()'.
It will be removed at the end of 2019.
For more information, see https://d.android.com/r/tools/task-configuration-avoidance.
To determine what is calling variant.getExternalNativeBuildTasks(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
Affected Modules: app
INFO: The specified Android SDK Build Tools version (27.0.3) is ignored, as it is below the minimum supported version (28.0.3) for Android Gradle Plugin 3.5.3.
Android SDK Build Tools 28.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '27.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.
Install Build Tools 28.0.3, update version in build file and sync project
Affected Modules: app
The thing that fixed it was opening Settings --> Appearance & Behavior --> System Settings --> Android SDK and I then selected some recent versions of Android SDK like 8, 9, and 10. (I had only had 5.1, 6.0, and Android N Preview installed.)
Once that's installed, I had to modify my build.gradle file for my Module: app
Removed buildToolsVersion '27.0.3'
Then I clicked the "Sync Project with Gradle Files" button on the toolbar. The Sync output window offered an option to "Update Plugins" and once I clicked through that everything seemed to work. For good measure I again clicked "Sync Project with Gradle Files" followed by Build --> Clean Project, and finally I was able to run my project again.
Resolution is simple. Open the "Android SDK Manager", update all packages and then restart your Android Studio. After that you project should compile without any issues.
It took me some time to resolve this.
Updated SDK Build-Tool [Didn't help]
Updated CMake [Didn't help]
Updated Android SDK Platform-Tools [Didn't help]
Updated Android SDK Tools [Didn't help]
Updated NDK [Problem solved]
There was a reason, I didn't want to update NDK. When all else failed, I updated NDK and that did the trick.
If your got timeout, Check Gradle Scripts -> gradle.properties in Android Studio, I found that I do have set a socket proxy in Android Studio settings, but in this gradle.properties file, my proxy became to http, so I just removed this http proxy setting lines, and finally works.
I got this problem on Android studio, there in either sync or build square were this link like blue text about this issue, press that button and it download something that fix this problem
I ran into the same issue, but then did the following, and my issue was resolved:
updated Gradle
installed the latest version of Android studio (mine was out of date)
And that solved my problem.
Note: It also helped me to click on the event log, because it has more detailed info about errors. https://developer.android.com/studio/releases/gradle-plugin#updating-plugin also has great info.
I've installed Android SDK Command-Line Tools from SDK Manager and after, juste Sync again and all is worked well.
it was hard to solve but i did it
look go to
C:\Users(user name)
delete .gradle file
its you didn't see it it may be in hidden files so if you use windows 7
right click then click on properties and click on hidden to be not checked
then the file will appear then delete it
i hope this works
It could be that you are using gradle in offline mode.
To uncheck it go to File > Settings > Gradle, uncheck the Offline Work checkbox, and click Apply
Make sure you have internet connection and sync the project again.
Its because the gradle is not synced because of many reasons.
Go to project folder and remove .gradle folder and start sync. It will work
Apparently, some platforms could be missing. This is how I solved the problem:
Do you see an error message that is shown at the bottom of your Android Studio window? It could be a smaller window on the bottom right also.., which looks like:
Now, Click on that blue link, do as the dialog boxes say (if any)...
That solved the problem. Hope it helps...
Download grade files from this url and extract all in a folder:
 https://gradle.org/releases
Open file -> Setting in windows OS or Preferences in mac OS and in "Build, Execution, Deployment"
Click on "Gradle"
Check “Use local cradle distribution” and give that extracted folder path.
Run gradle.bat for Windows OS and gradle file for mac OS in that folder.
Then check “Offline work”.
"your extracted folder path"/gradle-4.10.2/bin/.gradle (for version 4.1.2 you can set your version)
Press OK and enjoy it.
I had the exact same error message
Error running android: Gradle project sync failed. Please fix your project and try again
, but if none of the above fixes your error, then I would highly suggest for you to check your syntax inside the AndroidManifest.xml file.
That fixed if for me. I don't understand why the error-message is so misleading, since it had nothing to do with the build gradle directly.
Please also see this SO-answer here, which has lead many of us in the right direction.
It was yelling at me about a line in my xml file (which was perfectly valid and never had problems the entire time I've worked on the project). I deleted the line and even after running again and cleaning and rebuilding it kept yelling at me about the completely blank line. I restarted android studio and removed the .gradle folder and it finally worked. Hopefully someone in my shoes that had all of the other answers in this thread fail them will see this answer and save a few hours.
I had this problem (clicked a prompt to "sync with gradle" on my perfectly valid and working project and it killed everything) and I researched for hours trying to figure out how to fix this, including this thread among many others. I finally found my solution, so hopefully, it'll help somebody (and hopefully they fix this terrible system)
I encountered this in a unique situation: had refactored the word "time" to "distance" for one of my variables. And when I did the refactor, accidentally had it change the name of one of my gradle dependencies / implementations.
This is a rare cause of the error, but a possibility. So make sure all your dependencies are properly implemented in build.gradle
Delete .gradle folder(root directory) and build folder(project directory) and then invalidate caches/restart android studio, run your project again hopefully it will work. It might take some time for the background tasks. In some countries, you may need to turn on the VPN to download.

Android Studio won't update says already on newest version

When I try to 'Check for updates' in Android studio I get the following message:
"You already have the latest version of Android Studio (Preview) installed."
I am on 0.5.2 and the newest version listed here http://tools.android.com/download/studio/canary/latest is 0.5.4. I have canary builds selected when checking for updates. Any ideas?
As Scott Barta has pointed out in a comment, this is because you have ignored the update, so it won't ask you if you want to update to it anymore.
The solution is simply to quit Android Studio, then edit its other.xml file, and replace the myIgnoredBuildNumbers block with the following one:
<option name="myIgnoredBuildNumbers">
<value>
<list size="0" />
</value>
</option>
other.xml is located under your Android Studio config directory:
For Unix: ~/.AndroidStudioPreview/config/options/other.xml
For Windows: %HOMEPATH%\.AndroidStudioPreview\config\options\other.xml (basically the same as the Unix path)
For OS X: ~/Library/Preferences/AndroidStudioPreview/options/other.xml
See this question and its answer for more information.
Go to Preferences > Updates and clear out the versions listed in the View/edit ignored updates section:

Resources