Android Studio - automatic project load - android-studio

I cannot find a way to prevent Android Studio from automatically loading the last project in use. I want it open me the beggining window with the list of projects available and not loading the last used automatically.

The location of Reopen last project on startup was moved to Settings => Appearance & Behavior => System Settings with new Android Studio, just uncheck it!

In Appearance & Behavior -> System Setting , also you can change some other setting about open or save projects
Android Studio 2.1.1 MacOS X
UPDATE
This screen can accessed in Android Studio 3.1.3 on MacOS High Sierra by selecting the Android Studio -> Preferences menu

Android Studio or Intellij IDEA:
From the menu go to :
File > Settings >Appearence & Behavior > System Settings.
disable the option:
Reopen last project on startup

Open Settings, go to General and remove check from Reopen last project on startup

If the project that is being reopened is causing android studio to stop responding you may not be able to get to the dialog. I got round this by deleting
~/Library/Preferences/AndroidStudio3.3/options/recentProjects.xml
This allowed me to temporarily start android studio without reopening the offending project, and then permanently disable the reopening feature using the dialog others have mentioned

I ran into this problem on MacOS when I added Android Studio Canary and Intellij. I'm not sure which caused the issue.
Anyway, here's the steps that I used to fix it:
Open Android Studio to see what project it opens; write down that project.
It will freeze, so you need to force quit it.
Erase the nodes where that project name exists. For me it was the last <entry> element and the <option> element in the recentProjects.xml file (location below). Make sure you delete the complete element!
Restart and it should work. Otherwise, repeat for the new recently opened project that is freezing Android Studio.
Where is the file?
~Library/Application Support/Google/AndroidStudio4.1/options
It took me digging up the location of Intellij files then back tracking it to Google then Android Studio to find where the file exists. I hope I save someone the time I wasted on this. :D
Extra note:
The <entry> node is in here:
<application>
<component name="RecentProjectsManager">
<option name="additionalInfo">
<map>

Related

Annoying "Create Desktop Entry" popup in Android Studio on Ubuntu 16.04

Recenty I installed Android Studio on my laptop running Ubuntu 16.04.
When I created a new project and used Android Studio, this annoying popup kept showing: (Because my low reputation, I cannot post images, please click the link below)
https://i.stack.imgur.com/zNMbk.png
I tried to check the checkbox but it still display everytime I click on anywhere in Android Studio.
Help me, thanks in advance.
Try to use this for creating a desktop entry: desktop-file-install THE_DESKTOP_FILENAME_HERE.desktop
It might be the solution (if error it's because it localized the fileB, if ok it will copy to the correct localization /usr/share/applications) Restart then
After trying many times, I decided to reinstall Android Studio and the error disappeared! I don't know the reason clearly but maybe using Create Desktop Entry in Android Studio and creating a .desktop file manually (after installing Android Studio, I wanted to add Android Studio icon to launcher) caused conflicts.
goto settings in android studio
keymap-> main menu-> tools-> create desk entry
right-click on "create desktop entry"
you will get an option to turn off it.

How to open an existing Flutter Project in Android Studio

I might sound noob here but I can't see a clear way of opening existing Flutter Project in Android Studio 3.1.2.
I checked this but it didn't work. So I want to know if there is a standard IDE way of doing this? I also can't find any docs clearly mentioning it. Do I need to install a 3rd party plugin?
After opening it as an Existing Android Studio Project, I get the following error:
The error is solved by running Get Dependencies. Is it a normal behavior?
Install Flutter plugin for Android studio: https://flutter.io/get-started/editor/
Open Android Studio
Open existing Android Studio project by using one of below methods:
EASIEST WAY: Drag your project folder and drop to Android Studio.
Other ways:
What works for me was to open existing Android Studio project like mentioned above, and then go to menu
Tools -> Flutter -> Flutter Clean
Then configuration window will open and ask you to locate flutter sdk. After locating the sdk, click OK and then the flutter functions will be available (Pub buttons, runs menu). After that you can proceed to get the dependencies (pub get).
It's basically cleaning the project folder of previous setting(s) which might conflicting with the system (android studio). But that won't happen if you get the project from source repository because all of the junk files wont be in the project folder.
The quickest way on macOS is
open -a Android\ Studio android when you are in the root project directory.
Alternatively, if you use the jetbrains toolbox, you can enable "Shell Scripts" in its settings. This will create a binary in the folder of your choice, so you have to add this folder to your PATH. Then, you can use studio . inside the Android folder, or studio android in the flutter project. The benefit of this, is it also works with other Jetbrains products (e.g. charm project_dir or clion project_dir. Unfortunately this method glitches out (for pycharm at least).
Looks like Android Studio can't load Android Application module from Flutter project automatically. I also have same problem, so in my situation Gradle can't be found, because of lack of Android project.
There's important note from official site:
Important: Do not use the New > Project from existing sources option for Flutter projects
I suggest, same is for Open option.
Just Open your project as normal, and then in [Android Studio > Preferences > Languages&Frameworks > Flutter > Flutter SDK path] select the path where you downloaded & unpacked Flutter SDK.
I know it's already late, but you can open an existing Flutter project in Android Studio by following these steps (make sure you have already installed Flutter & Dart plugin and Flutter SDK):
Click Open from File menu in Android Studio,
Go to the path of the project,
Click Open from the dialog,
When the project opens in Android studio, it will show an error of packages and dependencies. So, click on Get Dependencies on the top. Android Studio will automatically add all the required dependencies and packages.
There is a simple way of doing this in android:
Just Open your project as normal, and on the top right corner, click on Flutter Attach option, and voila!
See Attached screen grab!
Usually you can open your Flutter project in Android Studio simply when you right click on the android folder > Flutter > Open Android module in Android Studio but sometimes this option could be disabled, check this answer to enable..

Project build.gradle file won't open, Android Studio

This is the first time I've encountered this issue with Studio. For both the project and app level files, when I double click to open build.gradle I get the following problems:
Android Studio 2.3 - File opens, but displays "Loading" indefinitely.
Android Studio 3.0 - File doesn't even open at all. Clicking on them does nothing.
Has anyone else seen this behavior before? And solutions? Advice would be appreciated.
I had the same problem. This plugin was causing it: 'Android Method Count'.
I deleted the plugin, and it worked
delete xxx.iml file, if that still doesn`t work, restart Android studio more.

Android Studio: "Update & Restart" doesn't work

Every morning after start of Android Studio I became a dialog with information about new version of Android Studio (Beta). If I click on "Update & Restart" the patch will be downloaded (I see the progress bar and the growing file size). After that the Android Studio will be restarted but... the update is not installed! I can repeat it if I click on "Help/Check for update".
Has anybody an idea how to fix this?
P.S. Sure it is possible to download the full version and install it manually, but it would be so convenient to use automatically updates.
I've solved the problem. It is important how Android Studio was started. If I start it with a workspace parameter:
/android-studio/bin/studio.sh /<path_to_workspace>
then the update doesn't work.
So the solution is to start the Android Studio without any parameters.
I successfully updated my AS from 2.1.1 to 2.2.2, by the following way:
File > Close Project. Close AS.
restart AS, it will not open any project and show you a project list, but please don't open any project.
wait for AS to popup a dialog to remind you there is a new version.
click "update & restart".
after restart, it may remind you import previous configuration files.
import configuration, open a project, you will see the new version number.
hope this will help.
I actually created the issue and it seems they fixed it in the latest release and you have to download it manually from here and update mechanism should be fine.
Ah, it happened to me just now.
In case you installed the Android Studio via JetBrain's Toolbox then the button is disabled if you start the AS manually. You need to close the AS and open the Toolbox and then update from there.

In android studio,cannot load 2 facets-unknown facet type:android and android-gradle

When I open android studio I am getting an error- "Error loading project: Cannot load 2 facets. When I clicked to see the error the following appeared
"2 facets cannot be loaded. You can mark them them as ignored to suppress this error notification.
Unknown facet type:'android', Unknown facet type:'android-gradle'
I tried to add facets ( In Project Structure > Project settings > Modules > clicked project name, then clicked Android as well as Android-Gradle) But both showed as "cannot load facet, unknown facet type." Under Project settings > Facets > both Android and Android-Gradle are displayed as 'Invalid facets'.
My project was running smoothly. This problem occured when I force-closed my laptop before exiting android studio as everything got stuck. After that whenever I open the android studio this problem occurs. I am not able to run my project. Can anyone please help me to solve this?
Just enable Android Support plugin.
Click Ctrl+Alt+S in Windows or Meta+Comma in Mac.
In top search bar type "plugin".
On right side it will show a list of plugins, find Android Support plugin, check it and click OK at the bottom of screen.
This is how it looks:
In Android Studio go to
File -> Settings - > Plugins -> Enable "Android Support" Plugin.
File, Then Settings->Plugin->Enable/Renable Plugin --> Apply --> Restart
This problem occured when i'd updated Android Studio.
In case nothing from other answers works, you don't have another option, except removing broken settings and making clean setup.
So what i am suggesting:
Use Settings Repository Feature to store personal IDE settings
close studio
remove .AndroidStudioX folder from user folder
re-launch studio, do not copy settings from previous version (because settings probably broken and auto-import couldn't import it well)
import personal settings from Settings Repository
For me I went to Settings -> Plugins and de-selected Gradle then immediately re-selected it. Android Studio then asked if I wanted to enable Groovy so I said yes and let it restart and now everything is happy again! (it was checked, but clearly somewhere deep down not truly enabled, so toggling the check-box sorted it)
Not sure if my cause was installing Flutter, but I did have to disable the Flutter plugin before I could build again.
I had the same problem with an ever-increasing number of facets - first 2, then 4, then 5 - and none of the above solutions worked. My solution (Android Studio 3.3, OS X) was to delete ~/Library/Preferences/AndroidStudio3.3/disabled_plugins.txt, which contained org.jetbrains.android and org.jetbrains.maven
I imagine if you have deliberately disabled plugins then you'll have to disable them again manually, but I was able to load all facets again.
Go To ->File->Settings->Plugins->disable/enable Android Support Plugins->Press Ok
Just re-enable Android Support plugin. Then it will ask to restart.
Restart them thats it
I faced this issue in Android Studio 3.2.1 I had to re-import my project after that it works.
I was facing this problem, I tried everything but nothing worked but then I remembered that I updated Android Studio just few hours back and then I enabled the plugins in the Android Studio and restarted it and it worked.
File -> Settings -> Plugin and then just press ok. It will ask to restart the android studio and please restart it.
For me I had to uncheck the plugin Android APK Support. I clicked Apply and then Ok to close the window. Android Studio prompted me to restart the program, and the program restarted. I checked the Android APK Support plugin again and restarted the program. And then I selected File -> Sync Project with Gradle Files
Then it worked just fine.

Resources