Making Android Studio accessible across multiple users in ubuntu - android-studio

I have a small problem. I have installed Android Studio on Ubuntu successfully. It is working fine. It is installed in the Admin account. I would like to make the studio available in the user account that I have created. Please guide.

The problem got solved. I hope this answers helps people who are facing a similar problem.
Solution to the problem:
Open terminal. Using sudo -i, become a root user and move the unzipped android studio folder into /opt
mv <your current folder location>/android-studio /opt
Once the folder is moved, cd into /usr/share/applications folder
Open the text editor and create a file named android-studio.desktop. Enter the following code into the file and save it.
[Desktop Entry]
Version=1.0
Type=Application
Name=Android Studio
Exec=bash -i "/opt/android-studio/bin/studio.sh" %f
Icon=/opt/android-studio/bin/studio.png
Categories=Development;IDE;
Terminal=false
StartupNotify=true
StartupWMClass=jetbrains-android-studio
Name[en_GB]=android-studio.desktop
Now install the desktop file.
desktop-file-install android-studio.desktop
Now android studio is accessible from the search menu
Close the terminal.
Launch android studio from the search menu (top left icon on the launcher)
Once android studio is running, you can right click on the icon on the launcher and lock it to the launcher.

Related

How to create second desktop entry for preview and stable android studio on Ubuntu

I want to install android studio preview alongside the stable version.
Download the .zip into ~/Download
/home/zelongg/Downloads/android-studio-ide-171.4444016-linux-3.1-canary-4.zip
sudo unzip android-studio-ide-171.4444016-linux-3.1-canary-4.zip -d
/usr/local/lib/android-studio-preview
sudo mv -v /usr/local/lib/android-studio-preview/android-studio/*
/usr/local/lib/android-studio-preview/
sudo rm -rf /usr/local/lib/android-studio-preview/android-studio/
zelongg#zelongg:/usr/local/lib/android-studio-preview/bin$ ./studio.sh
create a new folder in ~/Android/sdk in case that the newly downloaded
sdk will affect the sdk in mini project.
we can successfully run android studio preview 3.1 canary 4
But we cannot create the second desktop entry somehow.
https://developer.android.com/studio/preview/install-preview.html
The 2 desktop entry means:
What I want is that it should show 2 icons for both Android Studio and Android Studio Preview seperately. But now they share one icon in the left bar.
I followed the instructions below, but it doesn't work.
To make the preview version available in your list of applications, select Tools
Create Desktop Entry from the Android Studio menu bar.
I used Create Desktop Entry from Android Studio Preview, which replaced the ~/.local/share/applications/jetbrains-studio.desktop of my stable version.
Then I copied that file to ~/.local/share/applications/jetbrains-studio-preview.desktop.
The icon was still green, so I downloaded a yellow one and used it in the .desktop file:
I also edited the .desktop file to suffix the name property with Preview
Then I ran the stable version to Create Desktop Entry to restore it.
Unity launcher didn't refresh the preview version icon and name straight away (it's ok after a reboot) and I couldn't figure out which one was which after typing Android Studio in the launcher. So I ran the jetbrains-studio-preview.desktop from its directory (first setting it to be executable), and then I locked it to the launcher. The result:
I tried the accepted answer but had little difficulty since I am not so good with the terminal. so I installed *nautilus Admin. using the command sudo apt-get install nautilus-admin
open Computer-> usr -> share right click applications select Open as Administrator. (for this option u need to install nautilus admin as stated above). right click existing android studio desktop entry select edit as Administrator.
In that file change the StartupWMClass property to jetbrains-studio-preview. that is done. now open your newly installed android studio and create desktop entry. and .... that's it.
just install stable and canary versions from ubuntu software store and their shortcuts are separate by default

where is the Android Studio executable

Where is the Android Studio executable file stored in the system?
I have it installed, but have unpinned it from the taskbar, which was the only shortcut I had. Since I can't find it in File Explorer, I can't load it.
I've tried the Start menu search function, and used File Explorer to search the entire install directory. The only thing left I can think of to do is reinstall it, but I don't really want to do that, as it was working fine.
P.S. I wasn't sure if this was more appropriate for SuperUser, since it's not directly coding related, or SO, since I doubt the number of people on SuperUser with the answer.
You can find the executable file in bin folder where the android studio is installed, default location is
Windows
C:\Program Files\Android\Android Studio\bin\studio.exe
There is also studio64.exe in the same directory for 64-bit machines
Linux
path_to\android-studio\bin\studio.sh
In Ubuntu/Gnome make sure you create an application file in
/usr/share/applications/android-studio.desktop
with the following content
[Desktop Entry]
Name=AndroidStudio
Type=Application
Exec=/path/to/android-studio/bin/studio.sh
Terminal=false
Icon=/path/to/android-studio/bin/studio.png
Comment=Android Studio
NoDisplay=false
Categories=Development;IDE;
Name[en]=AndroidStudio
This way you will be able to find Android Studio in the applications list, create desktop shortcuts for Android Studio or add it to the favourites bar.
I don't remember how did I installed Android Studio on my Ubuntu 16.04, but my android studio executable is located as /snap/bin/android-studio.

Android Studio DDMS can't open /data folder in an emulator phone

I recently created an Emulator device with Android Studioļ¼Œbut only to find that I can't open the /data/data folder to get the sqlite db file.The folder just can't open,I have tried to use shell scirpt to chmod the /data directory,but it says the su command not found.
The Emulator
Can't open!
Is there anyone has the same problem? Or I have to root the Emulator?
But it's an Emulator! I just think it's kind of inconvenient to root a Emulator!
Update
Can't remember whether it's from Android Studio 3.0 or later but if you have downloaded AS 3.3+, you'll find the tab on bottom right corner called Device File Explorer, which lets you to see and easily get the data of your app without rooting.
Opening as Administrator didn't help but rooting the phone did worked, and no I'm not lowering my SDK version.
Open cmd and go to C:\Users\{User}\AppData\Local\Android\Sdk\platform-tools or to the folder location and type cmd at the address bar.
Whether you're super user or not can be determined by $:
C:\{User}\...\platform-tools>adb shell
generic_x86:/ $ exit
To have su/root privileges type adb root and exit:
C:\{User}\...\platform-tools>adb root
generic_x86:/ # exit
Next run the Android Device Monitor to extract the data.
To turn off root type adb unroot.
Even after running Android Studio as administrator if you can't access data/data folder, try using API 23 or lower for you emulator device.
Using Android Studio 3.1.2 and DDMS is no longer available under the Tool options. Instead Android Studio has the "Device File Explorer" tab available on the bottom right (I know why put it there).
Click on the "Device File Explorer" tab and select the Android Device you want to explore. To actually access the files, make sure USB Debugging is turned on in the AVD.
If that doesn't work, you'll need to use Terminal panel.
Change the folder permission through adb shell (using chmod command)
Pull the file using
"adb pull". See example:
C:\Users\B\AppData\Local\Android\sdk\platform-tools> adb pull /data/data/com.example.b.expensewatcher/databases/myexpenses.db
/data/data/com.example.b.expensewatcher/databases/myexpenses.db: 1 file pulled. 3.3 MB/s (24576 bytes in 0.007s)
For more details on changing folder permissions see: https://www.dev2qa.com/android-device-monitor-cannot-open-data-folder-resolve-method/
open DDMS with administrator previlledges. Had same issue and it solved it.
Fastest means to doing this is opening android studio with administrator previledges and opening DDMS from there.
otherwise, have a look at this link Android device monitor
Instead of rooting your android phone, you can access the data folder from android studio by opening 'device file explorer' which is to the bottom right corner of your IDE.
Open 'data>data>packagename>databases' you can save the database files but this will be in the encrypted form. You can directly access it from the file explorer on your PC.
Install DB Browser for SQLite and select option 'open database.'
Connect your android device and enable 'File Transfer'. Go to the directory where your android studio has been installed i.e., in my case documents. Then,
C:\Users\prana\Documents\AndroidStudio\DeviceExplorer\xiaomi-redmi_note_4-164594b\data\data\com.android.packagename\databases
You can find your databases here.
Hope it helps!
Use adb to root the emulator device. Once that is done, you will have permission to access the data\data folder
adb shell
su
The adb tool will be present in Users\\AppData\Local\Android\sdk1\platform-tools
Open cmd, change directory to above folder and enter the above code
Restart Android device monitor (if needed)

New version of Android Studio is not opening

I recently downloaded a new version of Android Studio, but after installation of the program, it asked options like to create new projects or others as I click on the project structure where I had to locate the path of the SDK. After locating its path correctly, it just froze. Nothing happens when I click the create a new project option. Instead of this, I clicked open the current project option. Android Studio opened, but without the SDK settings. When I go to the SDK manager to locate the path of SDK, that SDK manager option is not loading. It keeps on loading and shows nothing.
This problem is only related to the new version, not with the Android Studio 1.5. What should I do to solve this problem?
i hope this command help you!!
For linux
open Terminal
Follow this commmand
cd /media/ubuntu/DATA/android-studio/bin
./studio.sh
For Windows
Follow this commmand
cd /media/ubuntu/DATA/android-studio/bin
./studio.sh

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

Resources