Android Studio "Unable to save plugin settings" - android

When I opened android studio today, it showed me the following errors:
Then, when after I restart Android Studio, I get these errors:
After I enable "Android Support", and restart, the first two errors show again, and when I restart again, I get this 3rd error again and the "Android Support" plugin is disabled again. (I even tried uninstalling and reinstalling Android Studio)
How can I fix this?

I have solved this problem this way:-
Go to File >> Invalidate caches/restart >> Invalidate and Restart
After restarted, If warning comes just click on Enable Android Support

I was using Gradle 4.1 and AS 3.0.1 when I got this error.
Look at Gradle console. If it looks anything like this, read on:
Plugin Error
Problems found loading plugins:
Plugin "Android Games" was not loaded: required plugin "Android Support" is disabled.
Plugin "Android NDK Support" was not loaded: required plugin "Android Support" is disabled.
Plugin "Android APK Support" was not loaded: required plugin "Android Support" is disabled.
Plugin "Google Developers Samples" was not loaded: required plugin "Android Support" is ...
...
Plugin "Fire... (show balloon)
Note that all say “required plugin Android Support is disabled."
Also note the link “show balloon”.
Click show balloon.
Choose to enable Android Support.
Restart AS.
I hope this helps you, too.

This can happen if a module is not added correctly.
Instead of adding the module folder, adding the build.gradle results in a broken project and issues with the Android Support plugins.
To check if this is the issue, try creating a new Android project. If the new project can be open fine (may require enabling the plugins and restarting Android Studio), then it is a project issue.
If this is the case, delete the incorrect module from the project, and if required re-enable the plugins and restart Android Studio.

TL;DR
I finally fixed it by removing .idea/workspace.xml and reenabling plugins worked.
Same issue happened to me when I installed AS 3.1 beta alongside AS 3.0.1(stable) and opened my project in it. It was ok for few sessions, until it wasn't. Can't figure out what exactly broke project configuration, but project would open in 3.0.1 and not in 3.1. Any other project would work on 3.1 too. Symptoms were the same: android support plugin is disabled, and it wouldn't enable. I tried invalidating caches, reinstalling AS (even 3.1 stable version won't work).
Eventually I noticed projectBackup and projectBackup2 folders created by studio in the project's root folder. They contained versions of workspace.xml file. So I removed these backup folders, and workspace.xml from .idea folder. Then studio asked to reload project and that's it - after that I could reenable all the plugins

For my case this seems to be a rights issue. When starting Android Studio with admin rights no problems occur.
Re-enabling the plugins as admin and starting AS again with my default user does not help.
Edit
I updated to the latest canary.
With the admin user I've installed AS.
I completly removed .AndroidStudio/config, .AndroidStudio/system and .AndroidStudio/plugins beforehand (I use a different location for these files, so I have to replace idea.properties after every installation. While doing this, I've noticed, that they renamed .AndroidStudio to AndroidStudio.2. That gave me the hint to remove those dirs.)
After this, I had no problems, regardless of which User ran AS.

None of the single solutions above where sufficient for me. I had the same issue after updating from android studio 2.3.3 to 3.1.2.
Close Android Studio
Remove .idea/workspace.xml
Restart android studio (your project with the issue is opened automatically)
A new .idea/workspace.xml is created
Sync project with gradle files
Open File -> Settings - > Plugins -> Enable
"Android Support" Plugin.
Android NDK support (I had to disable and re-enable it)
Restart Android Studio

I got this error today, I updated the Android Studio from Help>CheckForUpdates>Update.
After that installed the missing Google Cloud plugins.
Now it is working fine.

Got this problem recently with Android Studio 1.3 and 1.4.2 (beta). This was caused by an OutOfMemoryError in the Java heap.
I solved it by increasing the -Xmx and -XX:MaxPermSize values in the studio.vmoptions file

In android studio Go to file->settings->plugin-> enable androidsupport

In my case, I am using Ubunto and I had to Unlock the Folder of my project:
type this command on Terminal:
sudo chown -R $USER: $HOME

You can try this:
Rename the folder where the project is in
Open the project in Android Studio (now you'll have to browse for it)
Wait until it's synced and close the project
Rename the folder back to original
That solved it for me. Just deleting the idea folder and invalidating caches did not solve the problem.

If you are getting "Unable to save plugin settings" or "unable to save settings" Error window,
and you have tried all of the other solutions listed here, but they don't work for you, try the following:
Invalidate Cache: but don't select restart yet, select just "invalidate".
Close project and then exit Studio
If you have a previous backup of your Settings folder, restore it now.
If not, you will need to Delete your settings folder. For example, in Windows:
/ < USER_HOME_DIR >/.AndroidStudioPreview3.2
or on Mac :
/Users/<USER_NAME>/Library/Preferences/.AndroidStudioPreview3.2
Delete the .idea folder for your project
Re-launch Android studio, but this time select import project
Android Studio will re-index your project, but now the error will be gone.
After Android Studio has completed a Gradle Sync, it's probably a good idea to also make a backup of the settings folder

In my case, I installed a plugin, and on an android restart, it was failing to start. This was causing the plugin workflow to not run completely, and give the above error.
Disabling the faulty plugin solved the issue.

I just replace the project build.gradle like below. And it works.
buildscript {
...
repositories {
mavenLocal()
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
maven { url "https://jitpack.io" }
mavenCentral() // jcenter() works as well because it pulls from Maven Central
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
...
}
allprojects {
repositories {
mavenLocal()
maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
maven { url "https://jitpack.io" }
mavenCentral() // jcenter() works as well because it pulls from Maven Central
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
}

Related

error:Connection reset (Gradle sync failed: Connection reset)

I am importing constraint-layout-start to android studio 3.0. I have kept in androidstudioproject folder that's the the path where all my android studio projects are stored. after importing its showing connection reset error. Here is the log file link: https://drive.google.com/file/d/1W1mGmIc67baZb4C5nGGecWm15ggB0Wp5/view?usp=sharing
i have all the SDK installed. tried to manually change the sdk verion to 21 which was running perfectly for my other projects, but here it didn't work.
i checked all the files are okay, i am not getting why this error occurs.
images of gradle page are given below.
build.gradle
gradle
Add google repository to your gradle file:
repositories {
maven()
//other repositories...
google()
}
Try to download from SDK manager:
SDK Manager Android Studio
Check your gradle and plugin version:
https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle
For Android studio 3.0.0
required Gradle version: 4.1
File > Project Structure > Project
required Build Tools 26.0.2
For Android Studio 3.4 Canary 8
Hope it will helpful!
Go To File>Settings>Build, Execution, Deployment>Gradle
and set your Android studio local gradle path like below image
i solve this problem in this way. be careful it causes with different problems like using proxy, dns connection windows , fire wall block , ....
anyway, i use proxy in file/settings/proxy in android studio and after that i set no proxy. after that whenever use kerio vpn or cisco gradle didnt work.
solution :open gradle.properties and remove every proxy script from there and sync gradle and work fine

Install repository and sync project

I am trying to make a new project for android wear but this error keeps showing up, I thought it was because I wasn't making new projects in the location I was making before but changing back the location didn't work.
but I when I am making a regular project for android phones there is no problem like this
Try doing the recommended steps that was provided in the SO Post.
in Android Studio, open Tools -> Android -> SDK Manager
under tab "SDK Tools" un-check the libraries causing problems
click "apply" to uninstall them
re-check the same libraries click "apply" to reinstall them
close SDK Manager and run Gradle sync / build
Need to take note the update last July 2017 as well.
Important: The support libraries are now available through Google's
Maven repository. You do not need to download the support repository
from the SDK Manager. For more information, see Support Library Setup.
Here are some important points that you needed for google maven taken from SO post:
In your root build.gradle, you have to add the google maven just like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
Somehow the 26.0.0 Versions didn't worked for me as well.
Try to use the version 25.3.1.
first of all disable your Anti-Virus if have any.
secondly follow the steps
In Android Studio, open Tool > Android > SDK Manager
under tab "SDK Tools" un-check the libraries that are previously checked
click "apply" to uninstall them
re-check the same libraries click "apply" to reinstall them
close SDK Manager and run Gradle sync / build
if this doesn't work then one who has a working A.S take his SDK files from App data

How do I "select Android SDK" in Android Studio?

After a successful import of an Eclipse-Android-Project into "Android Studio 1.4", I get the error
"Please select Android SDK"
when I click on the button to run the application in the simulator, I can't find any way of doing that.
This dialog opens when I click on "run":
This is the "project structure" dialog:
What should I do now?
I go to build.gradle and click sync now. Then it worked.
Update :
File -> Sync Project with Gradle Files (Android Studio 3.1.1)
Tools -> Android -> Sync Project with Gradle Files (Android Studio 3.0.1)
Or You can click on the icon from the toolbar.
This answer may not help works for later version as Android studio Team work on making the tool more better, the way to sync may be different in the next version of Android Studio.
COMMON WAY that may helps is try to sync project and then Invalidate Caches and Restart Android Studio.
Solution for Android Studio 3.1.2 [See below answer]
See Latest Android Studio version
FIX FOR 3.1.2 OR NEWER VERSIONS
Some of my colleagues and I have faced the same issue on AS 3.1.2, but a simple Sync didn't help us. For us, the solution was a bit different:
File -> Invalidate Caches -> Invalidate
File -> Close Project.
Remove the project from the AS project selector window.
Quit from Android Studio
Start AS and open project again
EXTRA ADVICE IF YOU ARE FACING THIS ISSUE CONSTANTLY
Some of you are constantly facing this issue, and this "solution" fixes it only temporarily. At the time we started getting this error, we used gradle wrapper 4.6 and Android gradle plugin 3.1.0, but since then we went back to gradle 4.4 and we use it with the latest Android gradle plugin, and we haven't seen this issue since then.
In Android Studio 3 and above, for Windows, Mac and Linux:
File -> Sync Project with Gradle Files
Solved!
Or you can do this by shortcut key:
Press ⌘ + Shift + A (Mac) or Ctrl + Shift + A (Windows, Linux). Then pop-up a Edit-Text and write "Sync Project with Gradle Files". Then press double click on the option.
Your problem is solved! It'll sync your gradle file with your project file.
Screenshot:
Click this icon to sync gradle
or edit any of your module gradle and then sync
Press "Ctrl+shift+A" and in the pop-up EditText, write "Sync Project with Gradle Files". After that double click on the appeared option. It will then sync your Gradle file SDK with the project file.
Just go to the (app level) build.gradle file, give an empty space somewhere and click on sync, once gradle shows sync complete then the Error will be gone
This is the easiest way to fix this issue:
Add a comment line to the gradle file
It will then ask you to Sync.
Click 'Sync Now'
Viola! You're done.
Now on Android Studio 3 and above, you can try to sync project with gradle like:
File -> Sync Project with Gradle Files
The menu structure and options have changed slightly as of Android 3.2.0. I fixed this error by changing the Module SDK in the following menu:
File > Project Structure > Modules > App File > Dependencies Tab > Module SDK
Make sure to hit Apply to save your changes.
The comment from #Nisarg helped: "set latest version in Compile Sdk Version"
I changed from API 8 to API 23 and the error message disappeared.
Press the first refresh button on the gradle vertical tab in Android Studio on the right
Press " ⌘ + Shift + A" on Mac (or "Ctrl+Shift+A" on Windows) and in the pop-up EditText, write "Sync Project with Gradle Files". After that double click on the appeared option. It will then sync your Gradle file SDK with the project file.
Follow these steps:
Goto Android Studio Settings
Search for "Android SDK" using search bar
Ensure the path to your android sdk folder is correct.
After that also ensure the path is automatically updated after a prompt in your project (local.properties) file. If not, do it manually.
Hope this helps.
There are multiple hit & trial solutions for this error. One of them will surely work for you.
Below are the solutions:
1.
Tools -> Android -> Sync Project with Gradle Files (Android Studio
3.0.1)
Go to build.gradle and click sync now
Click hammer(Build) icon to sync Gradle
or edit any of your module Gradle and then sync
File -> Settings -> Android SDK -> Android SDK Location Edit ->
Android SDK
Open build.gradle file, just add a space or press enter. Then sync
project.
File -> Invalidate Caches / Restart
Go to File >> ProjectStructure(⌘;). This would open this window then select the app module. Then choose the Compile SDK version . Choose the latest one and click apply.
I was having this problem on all versions of AS 3.0+. Syncing with gradle did not solve the problem for me. The solution from András Klöczl was the only thing that would allow me to get some coding done. The problem was, anytime I had to do a gradle sync, the problem came back. So I had to go through that process any time I wanted to make a change in my build.gradle. What ended up working for me was to downgrade my kotlin version from 1.2.40 to 1.2.30
My problem was that if I changed the project (for example opened new window of Android Studio with different project) this error happened.
So I read every answer in this question and the "clear caches and open the project again" solution wasn't so useful in my case.
Instead I discovered that if the Kotlin's plugin's version in Android Studio was lower than in gradle file, the problem appeared.
My setup was:
Android Studio 3.1.3
Kotlin plugin (in Android Studio) 1.2.30
Kotlin version in gradle file 1.2.51
What fixed the problem?
I updated the Kotlin plugin:
File -> Settings -> Plugins -> Install JetBrains plugin...
Then search for Kotlin and click Update. After update just restart the Android Studio and sync Gradle.
Just change build tools version to 25.0.3.. and sync now
I hope it will help..
This worked for me.
File -> Settings -> Android SDK -> Android SDK Location Edit -> Android SDK
Go to : File > Project Structure > Modules -> app > Properties
please choose : Compile 'SDK' version = API26 Build Tools
Version = 27.0.0 Source Compatibility = 1.8 Target Compatibility =
1.8
open build.gradle file. just add a space or press enter. then sync project. it works...
Sometimes android studio just acts stupid and needs some kind of reset..
Go to settings.gradle file it should contain include ':app'
change it to include ':ap' and sync.
after sync, change it to include ':app' again.
It should be working OK now.
The simplest solution for this problem:
First make sure your sdk path is currect.
Then
Please close current project and in android startup menu click on import project and choose your project from explorer.
This will always solve my problem
In my case there there is no selected java sdk version in project structure-
I had to select the -
1.Source Compatibility (1.7)
2.Target Compatibility (1.7)
as shown in image.
If you are using 'Profile or Debug APK...', then you might come across this error.
My solution is to first check SDK for updates in SDK manager: click on "Edit" at the right side of SDK location and go through to install any updates:
Then I clicked on "Logcat" at bottom of Android Studio and find out I also need to configure Android SDK, so choose latest Android API Platform:
After that, I'm able to run the APK in Emulator.
In latest android studio 3.3.2 the icon of sync project with Gradle Files is changed
Now try this
File -> Sync Project with Gradle Files (Android Studio 3.3.2)
For Android Studio 3.5, "File -> Sync project with gradle files" is enough.
Go to gradle.build file and click sync now
OR
click icon on Sync project with Gradle file
OR
Go to Tools-> Android -> Sync project with Gradle file
If your android SDK path is given and still you facing this issue then it might because your android studio not synced well, even you have clicked on "Sync now" link.
So for re sync it go to app gradle file and make any change or just give a space and now sync again. It will work perfectly.
In my case I downloaded a git repository for an android project. The project required minimum sdk version 21 and target sdk version 27. When I tried to run the project it gave me "Please select Android SDK error". I checked that I had already downloaded the required sdk files.
For me the solution was to "sync project with Gradle Files"

Android studio error After run the project

I am getting following error while trying to run my app from android studio
Execution failed for task ':app:compileDebugJava'. Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
After searching on internet, I found some solution like this
export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_45/
so i gave this command in terminal from android studio dirctory but its not workout it show the same error again.
Updating my Gradle build version did the trick for me.
Old:
classpath 'com.android.tools.build:gradle:1.0.0'
New:
classpath 'com.android.tools.build:gradle:2.2.3'
Edit: Since this answer is still being used frequently, note that Gradle 2.2.3 can probably be substituted with any newer version of Gradle. This version just happened to be the version I was using when I originally answered the question.
In your android-studio
find it in File->Other Settings->Default Project Structure->SDKs. Then i changed JDK home path.
To fix this error in Andriod Studio 2.3.1 I had to go to File > Project Structure or Ctrl+Alt+Shift+S then go to SDK Location which was already open for me and then uncheck "Use embedded JDK" and point to where my installed version was.
To fix this error in Andriod Studio 2.3.1 I had to go to File > Project Structure or Ctrl+Alt+Shift+S then go to SDK Location which was already open for me and then uncheck "Use embedded JDK" and point to where my installed version was.
*
The mentioned post really solved my problem after long searching.
*
In the android studio
Window -> preferences -> Java -> Installed JREs and select your JDK home path
or else please follow the link to set JAVA_HOME in linux machines
In your android-studio find it in File->Other Settings->Default Project Structure->SDKs.
Then Check with JDK LOCATION select Installed JDK Location and APPLY IT.
I have this problem a lot when I try to open older projects for the first time. It seems that I just need to update the classpath under build.gradle:
In my case the old version was:
classpath 'com.android.tools.build:gradle:1.3.0'
and I updated to:
classpath 'com.android.tools.build:gradle:2.3.2'
Sync the gradle and it should compile.

Android Studio 4.0 stuck refreshing, can't run project

I just upgraded my Android Studio from 3.7 to 4.0. After upgrading, I changed the gradle dependency to 0.7.+ as indicated in the release notes.
Now, the IDE is stuck with a background task that says it is "Refreshing" my project.
I cannot run the project or do anything as those gets queued behind this task.
Note: it did a maven central update of about 100 MB before which completed successfully.
This is how I resolved it
Step 1: Modify build.gradle
Open the build.gradle in your module (not the top-level build.gradle file)
Change the following (or something similar
classpath 'com.android.tools.build:gradle:0.7.+'
to
classpath 'com.android.tools.build:gradle:0.6.+'
Save.
Step 2: Restart Android Studio
Step 3: Fix build.gradle
Android Studio will nag you about Gradle version. Let it fix it. (You might have to manually change it to 0.7.+).
Click on Sync Project with Gradle Files then gradle will download the dependencies and it's fixed.
I had the same issue. I just updated my android studio to 2.0 on ubuntu 14.04. This issue arose for one of the project and it was solved through a [answer][1] here which seems unrelated to this problem !!
If you are using Android Studio 2.0 Beta, this issue might appear (more likely if you are working on NTFS filesystem) and it seems like the "Instant Run" is the culprit. Search for "Instant Run" in settings and uncheck the box
Posting here to an old question - maybe somebody else might me stuck on this aswell.
I fixed it too.
change project level build.gradle classpath from 0.7 to 0.6
restart the android studio
import module and notice me to upgrade build.gradle version and change 0.6 to 0.7 manually and downloading maven resource successfully.

Categories

Resources