AndroidStudio opens previous project - android-studio

If I run androidstudio from project A folder, it still opens the last opened project instead of the project in the current directory.
Is it possible to force androidstudio to open the project from the current folder from command line?

Navigate to Settings-->Appearance & Behavior--> System Settings and uncheck
Reopen last project on startup
Hope this helps

Related

How to open Activity_main.xml on Android Studio

When I try to open the activity_main.xml I get Design editor is unavailable until a successful build.
I fixed it before by using the clean project and rebuild project but it does not work when I opened the file again. I tried the solutions found on this answer: Android studio design editor is unavailable until after a successful project sync but it didn't worked for me.
Go to the files, open folder res (resources), after press layout and finally there is the activity_main.xml.
Open your android studio and go to File and click on Sync Project with Gradle Files this will solve your problem. As cleaning your project and rebuilding it won't work unless you sync the project.
After the gradle has finish building, you can go to file menu and click on Sync Project with Gradle Files which is present here:

Flutter: How to import existing Flutter project, as a gradle project

How to import existing Flutter project, as a gradle project? 'Import Project' wizard asking for Gradle home path.
I have gradle, installed in my system. But what (which path) needs to set here.
Here is, what I'm trying:
Error
I had also gone through this problem where I have to import the existing Flutter project in Android Studio. I was able to import the project following below steps:
Open Android Studio
Goto File -> Open -> In Open File or Project window select the project you want to import.
Once you have done above steps try to resolve warnings shown in the log window. Warnings may be like update dependencies used in the project, etc.
Hope it will help you out.
I faced the same issue.
The gradle home directory (on my Windows machine) is located under:
C:\Program Files\Android\Android Studio\gradle\gradle-4.1
(please check the gradle version).
This will allow you to open the project. Then, you will most certainly need to "upgrade to gradle".
If this does not fully work, you might also consider using Visual Studio Code, which makes the "import" much easier: simply open the folder where you project resides. Optionally, you will have to resolve missing packages (-> Fetch packages). It should then be possible to run the project.
Hope this helps.
File - Open - Select the project root directory
Open Flutter settings from the tip menu - Click the pull-down menu, then flutter sdk dir appeared
Run
Or you can just use the flutter run command after step 1.
If you first add the flutter plugin for Android studio, then you can directly import the project as an Android Studio project and it should work fine.
In my case, having Android Studio 3.4.2 and Flutter 1.7.8, I only needed to:
1 - Open the project with the option "Open an existing Android Studio project".
2 - Run "flutter pub get" to get the packages listed in the pubspec.yaml file.
3 - Run the project with "flutter run"
If you are using Google services, don't forget to add your google-services.json file in your project. In another case, the project will fail without a clear message when you try to run it.
For Import exiting Flutter project.
Please choose Import Project because of Android Native application mean import use of android app only.
So use File -> Open -> Select Project root directory.
After open if ask for dependencies then Choose to Get dependencies

How to solve the issue of Android Studio 3 (3.1 canary) Preview: Cannot import project

I am working on Android Studio 3 Preview at the moment. However, whenever I tried to open an old project it says:
The project file specified already exists.
I have deleted:
Old code/project from hard disk (completely)
Removed the project from the project list.
Any tips on this?
This needs two steps:
You must delete the .idea folder under your project. It is a hidden directory. use ls -a to find it out.
Right click build.gradle and choose application. It probably popup a window asking for a program to open it, choose Android Studio.
I faced the same problem with 3.1 and .idea folder was also not there. Still it was not working. So instead of doing "Import Project" I did "Open an existing Android Studio project" and it worked.
I encounter same problem recently when opening existing Android Project,
deleting .idea or open directly build.gradle through Mac OS Finder work for me
Open the gradle file (select Android Studio if an application picker pops up) and it should bring up the "Import Project" dialog.
Just go to your Project Location Delete All files like .idea, .app etc and Relocate Your Project Location.

Internal error. Please report to https://code.google.com/p/android/issues

Anybody knows how to get around this issue while launching Android Studio?
I saw a Google ticket here, but it was not useful: https://code.google.com/p/android/issues/detail?id=164202
Internal error. Please report to https://code.google.com/p/android/issues
java.lang.AssertionError: Unexpected node Pythonid; nodes=[org.jetbrains.plugins.terminal, org.jetbrains.plugins.javaFX, org.jetbrains.plugins.gradle, org.jetbrains.plugins.github, org.jetbrains.java.decompiler, org.jetbrains.idea.maven, org.jetbrains.android, org.intellij.intelliLang, org.intellij.groovy, org.editorconfig.editorconfigjetbrains, hg4idea, com.millennialmedia.intellibot, com.jivesoftware.robot.intellij.plugin, com.intellij.ui-designer-new, com.intellij.tasks, com.intellij.properties, com.intellij.modules.xml, com.intellij.modules.xdebugger, com.intellij.modules.vcs, com.intellij.modules.python, com.intellij.modules.platform, com.intellij.modules.lang, com.intellij.modules.json, com.intellij.modules.java, com.intellij.modules.androidstudio, com.intellij.modules.all, com.intellij.java-i18n, com.intellij.copyright, com.intellij, com.google.gct.testing, com.google.gct.login, com.google.gct, amailp.intellij.robot, TestNG-J, Subversion, JUnit, Git4Idea, Coverage, CVS]
at com.intellij.util.graph.GraphGenerator.buildOuts(GraphGenerator.java:55)
at com.intellij.util.graph.GraphGenerator.<init>(GraphGenerator.java:36)
at com.intellij.util.graph.GraphGenerator.create(GraphGenerator.java:40)
at com.intellij.ide.plugins.PluginManagerCore.createPluginIdGraph(PluginManagerCore.java:543)
at com.intellij.ide.plugins.PluginManagerCore.initializePlugins(PluginManagerCore.java:1126)
at com.intellij.ide.plugins.PluginManagerCore.initPlugins(PluginManagerCore.java:1256)
at com.intellij.openapi.application.impl.ApplicationImpl.loadApplicationComponents(ApplicationImpl.java:348)
at com.intellij.openapi.application.impl.ApplicationImpl.<init>(ApplicationImpl.java:215)
at com.intellij.openapi.application.ex.ApplicationManagerEx.createApplication(ApplicationManagerEx.java:45)
at com.intellij.idea.IdeaApplication.<init>(IdeaApplication.java:112)
at com.intellij.idea.MainImpl$1$1.run(MainImpl.java:47)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
at java.awt.EventQueue.access$300(EventQueue.java:103)
at java.awt.EventQueue$3.run(EventQueue.java:706)
at java.awt.EventQueue$3.run(EventQueue.java:704)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
It looks like you have a corrupted installation file - completely uninstall Android Studio and download it again from the website.
Install the newly downloaded version of Android Studio on your system - the one you had previously downloaded is likely corrupt.
Here are the instructions to uninstall Android Studio completely. Note that some files may be located in a different location depending on where you chose to install and the versions you've been using so if something is not in its normal place, please let me know.
Please follow all of the steps below in order.
Run the uninstaller
The first step is to run the uninstaller. Open Control Panel by accessing it from the menu when you right-click the Start Button (This applies for Windows 8 systems). Then, under Programs, select Uninstall a Program. After that, click on Android Studio and press Uninstall. If you have multiple versions, uninstall them as well.
After you have uninstalled Android Studio, it is recommended that you restart before proceeding with the steps below.
Remove the Android Studio files
To delete any remains of Android Studio setting files, in Windows Explorer (The file browser in Windows), type this as the File Path:
C:\Users[YOUR WINDOWS USERNAME]
Replacing [YOUR WINDOWS USERNAME] with the username of your account on Windows. If you don't know your username, navigate to C:\Users and it will list all users on the system.
Here, delete .android, .AndroidStudio and any versions of this directory with versions on the end, .gradle and .m2.
Then, go to
C:\Users\Harry[YOUR WINDOWS USERNAME]\Roaming
and delete the JetBrains directory.
Finally, go to
C:\Program Files
and delete the Android directory.
Remove the SDK
To delete any remains of the SDK, in Windows Explorer, type this in as the File Path:
C:\Users[YOUR WINDOWS USERNAME]\AppData\Local
Here, delete the Android directory.
(Optional) Delete all previous projects
If you want to delete any of your previous projects, the directory where your projects are found is the AndroidStudioProjects directory. It is located in your root user file, C:\Users[YOUR WINDOWS USERNAME].
Hopefully this will now have deleted the Android Studio files and you can now try reinstalling the tools.
If you have any problems doing so, give me a shout :)
1st step please disconnect your internet connection and restart the studio.
If it is not working??? Do the following steps.
Open the folder bin under the directory where you installed your Android Studio.
Find the file idea.properties and open it with Notepad++/UltraEdit/other_edit_tools.
Add disable.android.first.run=true as the final line and save the file.
Restart Android Studio.
Remove lib folder .local/share/Google/AndroidStudio4.1/marketplace
or execute command
rm -rf ~/.local/share/Google/AndroidStudio4.1/marketplace/lib
To recover from this state, you need to remove the "python" folder that you find here:
~./AndroidStudio1.2/config/plugins
(Found at https://code.google.com/p/android/issues/detail?id=164202, worked for me)
I have this problem in android studio in linux OS after install a plugin,i resolved this issue with deleted.AndroidStudio3.2 folder from Home Directory and other way you can go to this directory and delete the plugin that caused it .
Directory : /home/your system's name/.AndroidStudio3.2/config/plugins .
and for windows OS you must go to this Directory :
C:\Users\your system's name.AndroidStudioPreview3.2\config\plugins
Note : this directory is hidden and you must visible befor use it .
I did faced this issue too, where it says to do this in my windows 10:
please report to https://code.google.com/p/android/issues in a windows error message.
It happened when i added some plugins in Android studio in Windows.
It persisted in my machine until i opened my Android Studio as an administrator and then uninstalled the most recent Plugins from File > Settings > Plugins > Installed Plugins.
What went wrong may be I added many plugins and applied all of them at once. May be i should have added one plugin at a time. Like install a plugin > apply that plugin and restart my Android Studio IDE in order to see it's effects.
MacOS
My issue was with a plugin. I tried all sorts of ways of deleting Android folders using terminal. Nothing was working for me until I searched all instances of AndroidStudio in Finder and deleted each of them. After reinstalling everything worked great!
I solved it by removing an incompatile plugin located here: ~\AppData\Roaming\Google\AndroidStudio4.1\plugins.
I deleted the folder "marketplace"
Open the folder bin under the directory where you installed your Android Studio.
Find the file idea.properties and open it with Notepad++/UltraEdit/other_edit_tools.
Add disable.android.first.run=true as the final line and save the file.
Restart Android Studio.
It information helped for me
<<~ ~ ~ Quick Solution for Windows 10, Hope it will help ~ ~ ~>>
Download the latest Android Studio from the official website
Uninstall the existing Android Studio from your computer. NB: Remove Settings Preferences too while uninstalling.
Restart your computer
Install the newly downloaded Android Studio
Delete the old directories which will show when run the Android Studio the first time after installation of the new Android Studio.
NB: Do not remove your SDK files after uninstalling the Android Studio, if you want to save your time in installing the Android Studio.
I have solved this problem, depending on the system you use delete the following files:
Linux:
~/.local/share/Google/AndroidStudioPreview4.1
Windows:
C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudioPreview4.1
MacOS:
~/Library/Application Support/Google/AndroidStudioPreview4.1
Thanks #Jonilson Coelho dos Anjos
For Ubuntu users
go to home
press ctrl+h to show hidden folder .local
now go to .local folder
you will find share folder, go inside share folder
find Google folder and delete it
Open Android Studio
Enjoy !!
delete paid plugin in android studio plugin folder (C:\Users\your_computer_name\AppData\Roaming\Google\AndroidStudio4.1\plugins) and will work correctly. it works for me.
paid plugin should have to activate otherwise it will conflict.
1) Go to
'C:\Users\your-user-name\AppData\Roaming\Google\'
2) Delete folder
'AndroidStudio4.1'
3) Then restart Android studio.
I hope this works for you.
I came with a new solution. Instead of uninstalling Android Studio and removing all related folders and losing your programming state on Android studio, and beside all these wasting your time, you should try this solution first which worked for me:
In my case the problem was the Windows. As it has crashed recently, I figured out the problem could be it, so I decided to restore the windows to the most recent point before Android Studio crashed. But the system restore tool didn't allow me to restore my system at all, and it said I should repair missing or corrupted system files first.
I first used Microsoft System File Checker tool thread to fix the case, and guess what? after restarting the windows 10, all problems gone. No need for uninstalling the Android Studio or removing any plugins or even restoring the windows to an stable state.
Hope this work for you too.
error Android studio
Hi everyone, I have this problem recently and I found the solution by deleting plugins which was corrupted in:
~AppData\Roaming\Google\AndroidStudio2021.1\plugins
-EmmyLua
-Luanalysis
My solution is:
Delete folder C:\Users\[user]\AppData\Roaming\Google\AndroidStudio
Delete folder C:\Users\[user]\AppData\Local\Google\AndroidStudio
Run AndroidStudio.
Note:
Android Studio will be opened like fresh install.
100 % solved
1st go to
C:\Users\your-user-name\AppData\Roaming\Google\
2nd Delete folder
List item
'AndroidStudio4.1'
'AndroidStudio4.1-backup'
DELETE ALL ALL ANDROID STDIO VERSION AND BACKUP RELATED FOLDER
3rd Start again android studio

Android Studio project files not showing up

I have a library project in Android Studio that has been working fine, but today I went to work on it and all of the files are missing except for a few git files. The folders/files are there when I look in the project's folder on my hard drive, they just aren't displaying in Android Studio. Here is a screenshot:
I tried reinstalling and updating Android Studio, but it didn't work. Any ideas as to what is going on here? How can I fix it?
Try Import Project... and navigate to your project. Select build.gradle file.
Be sure to wait for a while, so that android studios can load all your stuff. Sometimes a restart will help, but since you reinstalled it, that shouldn't be the problem.
Go to File > Project Structure > Project Settings > Modules.
Click on the green colored + and add new module. select Application module and set the content root to your project module.
Click next and then finish.
This should do the trick and the complete project structure will appear. It worked for me.
I had to Sync Project with Gradle Files in Android Studio to get my files back after they disappeared in Android Studio's Project window.
Go to
File > Project Structure> click on + > then set it to android
Go to:
File > Sync Project with Gradle files.
It will show up all the files linked with the gradle.
You can reset the IDE configurations by removing the configurations folder manually.
First close your project in Android Studio
In the project's root folder run:
rm -r .idea
Open your project again.
In my case i have a slash in the subproject
settings.gradle
As an example, this did not work:
include ":somedir/library"
But changing it to this fixed it:
include ":somedir-library"
project(":somedir-library").projectDir = new File(settingsDir, "somedir/library")
In my case, it was because of the NDK version
In my case only File -> Invalidate Caches / Restart... works.

Resources