Android Studio 3.1.2 can't delete file opened by itself - android

I just installed brandnew Android Studio and haven't to mess with the configuation. It happened when I try to clean Kotlin project, I didn't even touch the code or the config manually.
Kotlin is configed by running Configure Kotlin in project and I press clean project. It fail to delete a file and it has to be deleted manually after closing Android Studio.
Later it failed to create debug directory 'C:\Users\myname\AndroidStudioProjects\thesimpleplainbasic\app\build\intermediates\res\debug'

Related

Android studio and 'trust project' problem

When I open any project or create a new project, ide shows the trust project option but it's not working
and Gradle doesn't sync, and trust project sync still available on top of the page
You need to clean up the `trusted-paths.xml`
It's located in the configuration directory of Android Studio (for MacOS)
~/Library/Application Support/Google/AndroidStudio2021.2/options
Quit Android Studio
Find the file trusted-paths.xml and clean up and save it.
Open Android Studio and your project

Gradle Error while running flutter project in Android Studio

I am completely new to flutter.
Yesterday I installed flutter, added path variables and it works straight from cmd.
I also created a project using cmd and opened it in Android Studio.
Import of Dart and Flutter plugins has done, too.
Then what the problem could be here ?
you need to delete cache of android studio and restart build of the project .
go to file in android studio and click in invalidate cache screen
This error means that a file that Gradle has downloaded has become corrupted.
Delete the .gradle directories in both your home directory and in your project's root directory and try building again.

Android Studio - Gradle sync failed: Already disposed

After updating to Android Studio 3.2 Beta 1, I started getting the following error for two different projects:
Gradle sync failed: Already disposed!
There is no error with Android Studio 3.1.3, and there was no error with various canary versions of Android Studio 3.2 before updating to beta 1.
I already tried everything I can think of (e.g. complete cleaning of project, including all generated .gradle/.iml/.idea files/folders, as well as a complete invalidate cache and restart of Android Studio) without success. The build works as expected from command line using Gradle.
This is not a duplicate of Android Studio Gradle Already disposed Module
EDIT
The event log is showing
Unable to save plugin settings: The plugin org.jetbrains.android failed to save settings and has been disabled. Please restart Android Studio
In the "IDE Fatal Errors" window, I am seeing the following exception:
'Gradle: backport-util-concurrent:backport-util-concurrent:3.1#jar' already disposed: --------------Creation trace:
java.lang.Throwable
at com.intellij.openapi.util.TraceableDisposable.<init>(TraceableDisposable.java:45)
at com.intellij.openapi.roots.impl.libraries.LibraryImpl.<init>(LibraryImpl.java:103)
at com.intellij.openapi.roots.impl.libraries.LibraryImpl.<init>(LibraryImpl.java:69)
at com.intellij.openapi.roots.impl.libraries.LibraryTableBase$LibraryModel.readExternal(LibraryTableBase.java:327)
at com.intellij.openapi.roots.impl.libraries.LibraryTableBase.loadState(LibraryTableBase.java:64)
at com.intellij.openapi.roots.impl.libraries.LibraryTableBase.loadState(LibraryTableBase.java:30)
at com.intellij.configurationStore.ComponentStoreImpl.doInitComponent(ComponentStoreImpl.kt:375)
at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:331)
at com.intellij.configurationStore.ComponentStoreImpl.initPersistenceStateComponent(ComponentStoreImpl.kt:121)
at com.intellij.configurationStore.ComponentStoreImpl.initComponent(ComponentStoreImpl.kt:96)
at com.intellij.openapi.components.impl.PlatformComponentManagerImpl.initializeComponent(PlatformComponentManagerImpl.java:54)
EDIT2:
More recent version of Android Studio 3.2 are having the same issue.
As it turned out, the problem was that I was trying to open a project directory that was a symlink to the actual location (on the same partition). Gradle (on command line) had no issues building the project from the symlinked location, however, opening it in Android Studio resulted in the obscure and non helpful error described above.
Simple solution
1.Delete module folder and modules.xml file under .idea folder.
2.Close Android Studio
3.Reopen and sync
Possible duplicate problem:
Android Studio 3.0 - Unable to save settings: Failed to save settings. Please restart Android Studio Android Studio 3.0 - Unable to save settings: Failed to save settings. Please restart Android Studio
This worked for me: Delete the .idea folder.
1) Go to File--> Settings -->Plugins Disable any plugins not loaded (i.e. red in color) #friederbluemle This may not apply to you.
2) Enable the one plugin, Android Support
3) Right-click on your 'app' directory (contains your module gradle.build file) in Android Studio and select 'Show in Explorer' --- this opens that directory.
4) Quit Android Studio. Get out of any and all instances of Android Studio to allow you to then delete the fold, .idea, in that directory.
5) Restart AS, you'll notice the project will not come up -- you'll have to pick in the dialog window that appears. That's ok. Pick it, and it will 'rebuild' the folder, .idea.
6) Go to File--> Settings -->Plugins Enable any and all plugins if any.
What worked for me was going to Android Studio File and Invalidate/Restart options.
What worked for me is as follows
Delete the .idea folder
Close Android Studio
Reopen Android Studio and allow it sync your project all over.

Gradle build never stops in Android Studio

I have an Android Studio project. When i compile it using Build -> make project menu the build take around 30 seconds. But when I launch my project using the "run app" or the "debug app" button the gradle build never stops. The process is stucked on "Gradle build running".
This had nothing to do with Gradle. It was because of some files I had in the assets folder, I removed these files and it works now. Gradle was looping trying to build again and again.
These files were created when I opened a Realm database I had in the assets folder using Realm Studio :
default.realm.lock
default.realm.note
default.realm.management
I guess it's kind of metadata files used by Realm Studio. They are always created in the same directory of the opened database.

Android Studio 3.0 stuck in refreshing project

After updating Android Studio 3.0 stable version from 2.3.3 my previous project is refreshing forever. I deleted app folder build file but it's not working.
I have faced similar issue. This what helped me to recover.
Close your Android Studio.
Remove the build, .gradle and .iml files (or use gradle clean)
Open your project path in command prompt. Execute gradlew build.
Once the build is success from cmd, open it in Studio.
If you are using gradle instead of gradle wrapper, use `gradle build'
"Refreshing project" generally means the new version of gradle is being downloaded. About 100MB of file will be downloaded during the process. Make sure you have a stable internet connection and wait for a while.

Categories

Resources