Android Studio : Unable to delete original file - android

I'm very new to android and I just recently cloned an Android project.
When Android Studios performs the indexing once opening the project, i get this error all the time.
this is the error I get from Android Studio.
Error:(89, 0) Failed to delete original file 'C:\Users\myname\AppData\Local\Temp\gradle_download8065263342645015068bin'
after copy to 'C:\Users\myname\.gradle\caches\modules-2\files-2.1\com.android.tools.build\gradle\1.5.0\1c3d2b23212349ffbe6479fcb04732c5cddaf98b\gradle-1.5.0.pom'
Open File

Try the next step to "Refresh" your IDE (android studio)
Choose File | Invalidate Caches/Restart.

Another possible cause is the Anti-virus. It may block Gradle or Java

There can be multiple reasons for this error but are usually linked to Rights. I solved this by following these 2 different steps at different times.
Run Android Studio as Administrator
Check if the your project folder is read-only ? If yes, remove the read-only attribute from Folder Properties.

If Invalidate Caches/Restart doesn't work, change your GRADLE BUILD TOOL to any lower Version, or different Version untill it works
For me I got the error for Gragle 2.2.3, but fixed when I changed to 2.1.3, you can try with different newer versions from here Gradle Build Tools

I was able to solve my issue by disabling the Instant Run feature of android studio.

Related

No builders are available to build a model of type 'org.jetbrains.plugins.gradle.model.internal.DummyModel'

After upgrading Android Studio to 4.0 version and in "gradle-wrapper.properties" :
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
I am getting the following error in Android Studio while syncing:
No builders are available to build a model of type 'org.jetbrains.plugins.gradle.model.internal.DummyModel'.
and unable to create or run the app build.
This can be one solution. I tried Copy and Cut everything in the setting.gradle file located in the project directory then SYNC project after Gradle is complete. Later paste the content back to the file and SYNC again. This not worked for me but for others, it worked.
Another solution is to downgrade the android studio to v 3.6.3 download by clicking here. You can follow these steps to downgrade the android studio. This solution worked for me and now I can build and run the application successfully.
I solved it by navigating to the Project settings in the settings.gradle file and COPY and CUT everything then SYNC the project after gradle is complete PASTE back the content you had copied and SYNC again.
This worked for me
Still not worked
Please use different gradle version.
ie case gradle-wrapper.properties. Instead of your version
distributionUrl=https://services.gradle.org/distributions/gradle-*.*.*-all.zip
update with
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Thanks
I tried all the solutions above but I didn't succeed so I uninstall android studio and then installed it again and saw all the problems solved and I have no problem . so I recommend you reinstall the program as a last step .
REINSTALL

Android Studio 4.0.0 - Unable to save settings: Failed to save settings. Please restart Android Studio

from a week I was updated my Android Studio version to stable version 4.0.0 then I am started getting this errors in my studio and unable to build the app.
Unable to save plugin settings: The plugin org.jetbrains.android failed to save settings and has been disabled. Please restart Android Studio
But I forcefully enabled all plugins in my Studio by going to File-->Settings-->Plugins --> All are enabled.
Select Embedded JDK in Android Studio
Try that:
delete the .idea folder in the android project folder where you faced this problem.
Close Android Studio. Now navigate to your projects .idea folder and rename the workspace.xml file to workspace-o.xml and delete a workspace.xml~ if it exists (i.e., AS has a corrupt workspace layout file).
This should fix the problem. Restart AS and configure the workspace back they way you like it (i.e., it will start with a simple view: View/Tools Windows/Project etc.).
I started my first project in Android Studio and my answer may not be the correct one. I ran into this problem during building the My Activity project. It always came back with this error asking me to restart. Finally I thought that the controlled folder file access is preventing me. I temporarily switched-off the protection(against Ransomware in Windows 10) and tried the Build. I stopped getting these messages. But, I have other problems I am looking into.
I deleted the .idea folder and then I invalidated the cache (file-> invalidate Cache/Restart)
This fixed my issue.

Android studio : when re-import the project it show's error and given a strange floders

while re-importing my project android studio show's plenty of errors
after cleaning and re-importing my project i have got an red circle with ā€œJā€ on my java files and i'am enable to run my project
Make sure that your gradle version is defined properly.
It seems that this project was on another PC and you imported it on your computer. I think that probably a gradle version conflict occurred and you have two options:
one is to let android studio download gradle version specified in TlaProject (gradle 2.4)
another solution is to edit app level 'build.gradle' file and change its version to a version which is available on your machine (to see which version is available on your system, please check 'gradle' folder inside installation folder of android studio)
My problem was solved by updating the version of android studio .

Android studio AssertionError: Don't invoke waitForSmartMode from inside read action in dumb mode

I have been facing this problem since i updated to Android Studio 2.1 RC . A quick google search shows that the problem is being faced by developers using Android Studio 2.1. The issue appeared in April and a solution have not been found yet.
I had the same issue. I fixed it with:
1. Build, Clean project.
2. Build, Build APK.
3. Build, Generate Signed APK
I ended up needing to delete the projects cache directory. You can just delete the .gradle directory so that it can be regenerated.

Android Studio build error or misconfigured

I am having trouble building with Android Studio on one of my computers. The same project was building fine and when I pushed to github and pulled from the other machine I get the following error
Argument 0 for #NotNull parameter of com/intellij/execution/configurations/GeneralCommandLine.setExePath must not be null
I tried generating a new default project and I get the same build error so it must be something with my setup.
Does anyone know what I can do to fix these issues? Or even how to completely uninstall Android Studio and start fresh? Thanks
I had same error. In my case it was caused because of modification some important configuration. I fixed the issue by executing following steps:
File -> Other Settings -> Default Project Structure
SDKs
Add new SDK (select JDK option)
Specify path to JDK (in my case it was "C:\Program Files\Java\jdk1.7.0_45")
Save changes
You can also check if you have configured path tho the Android SDK
Good luck!
Had the same problem. Had to uninstall Android Studio, delete all files related to it including install files, the .AndroidStudioPreview folder under your user directory, and those files made in your project's folder upon importing. This amounts to the idea folder and the [projectname].iml file. Now reinstall and re-import the project. You can reuse the same build.gradle. Mine's working now.

Categories

Resources