How to execute .sh file on Linux MInt 19.3 "Tricia" - android-studio

I've downloaded android studio from it's official page: https://developer.android.com/studio/index.html#downloads
and I got a .tar.gz file.
After following [this tutorial][1] of "how to install android studio on Linux Mint" I wanted to execute the "studio.sh" file directly like an executable, so I followed some tutorials but i didn't work as expected.

Right click on panel > Panel > Panel preferences > Items > Double click on added launcher > Add new empty item > Set up like the 2nd image.
So I just added a launcher on Panel and set the command like: "/opt/android-studio/bin/studio.sh" and I got it! :D

Related

Can I input Git command in Android Studio IDE?

I use Github in Android Studio 3.3.1. I know I can open Version Control using Alt+9.
And Git command and result will be displayed in Console of Version Control. Can I input Git command and run it directly in Android Studio IDE ?
Yes sure.
About android studio on Windows you can change default command line to "bash"
First install git bash
then Setting in android studio to run terminal from bash
File -> Settings search for "terminal"
In topic "terminal" select on "Application settings" title then change "Shell path" to the directory of installed "git bash"
default root shell is "C/Program file/git/bin/bash"
close your current terminal and open new one in android so you will see new terminal with can use git command.
From your Android studio ->
Go to -
File->Settings->Tools->Terminal
Make your settings there.
Hope you will be able to find out the Terminal.
or, for windows 10 on the File->Setting->Terminal->Shell path change the cmd.exe to powershell.exe. You will get git and also more linux commands plus some cool colors etc.

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

Error "Dependent package with key emulator not found" while updating Android SDK and tools

I tried to update my Android Studio and got this error. How can I fix this?
I don't have much experience with Android studio and Android app development.
I am using Android Studio 2.3 and Linux.
This worked for me as this post try: Update 2
https://stackoverflow.com/a/42735118/5133603
Update 2:
Solution to emulator package issue!
After digging in the repo's XML for a while I've spotted the issue.
It turns out that the "emulator" package is only in channel 3 (canary) while the "tools" package is in channel 0 (stable) but depends on "emulator". The solution is to force the manager to download the "emulator" package from channel 3:
./sdkmanager --channel=3 emulator
Problem solved!
This is what worked for me:
Download the command line tools, place them in the SDK folder (e.g., on mac: /Users/user/Library/Android/sdk), and then add the bin folder to the PATH.
Install the latest platform: in a terminal, execute sdkmanager "platforms;android-25"
Open Android Studio, and go to the SDK Manager (Appearance and Behavior > System Settings > Android SDK)
Click on "Edit", and then select the sdk folder. Then "Next" > "Next" > "Finish".
I hope this works for you too.
Temporarily change update channel to Canary Channel (Settings > Appearance & Behavior > System Settings > Updates). It works for me (Windows, Android Studio 2.3) I hope, this bug will be fixed in the next version of Android Studio.
My solution using Void Linux (it should fix for other distributions too):
Create a new folder named Sdk in this exact path. Bash example: $ mkdir $HOME/Android/Sdk
cd to this folder, and download the latest SDK command line version. Bash example: $ curl https://dl.google.com/dl/android/studio/ide-zips/2.3.0.8/android-studio-ide-162.3764568-linux.zip
Extract the android-studio-ide-162.3764568-linux.zip. It must be this way: $HOME/Android/Sdk/tools
Launch Android Studio, and then proceed with normal installation.
PS: If you don't have a Android folder on your $HOME, you should create it, and then make the steps 1, 2, and 3, select the $HOME/Android/Sdk Folder in Android Studio → Configure → *SDK Manager → Edit, and proceed to step 4.
Start "Android SDK Manager" from this path:
%Android_home%\SDK Manager.exe
Install all updates from this manager.
P.S. This worked for me.
This is what worked:
Download the command line tools and place them in the SDK folder (on mac:~/Library/Android/sdk).
Install Android studio 2.3 (on mac: /Application/Android Studio.app)
Add path to java in Android Studio (export PATH=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin:$PATH)
Set JAVA_HOME (export JAVA_HOME=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home)
cd to ~/Library/Android/sdk/tools/bin and execute ./sdkmanager "platforms;android-25"
Accept the license - this will install the android-25 platform
Launch Android Studio, and goto the SDK Manager. The SDK Manager will now recognize the SDK path (~/Library/Android/sdk).
Now install the rest of the tools.
This fixed it for me (on a fully-patched Ubuntu 16.04 (Xenial Xerus)).
Disclaimer: I cleaned up everything beforehand:
rm -Rf ~/android-studio/ ~/.AndroidStudio2.2/ ~/.android/ ~/Android/
Then:
wget https://dl.google.com/dl/android/studio/ide-zips/2.3.0.8/android-studio-ide-162.3764568-linux.zip
wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
unzip android-studio-ide-162.3764568-linux.zip -d ~/
mkdir -p ~/Android/sdk
unzip tools_r25.2.3-linux.zip -d ~/Android/sdk
~/Android/sdk/tools/bin/sdkmanager "platforms;android-25"
~/Android/sdk/tools/bin/sdkmanager --channel=3 emulator
~/android-studio/bin/studio.sh
Click "Configure" in the launch window
Select "SDK Manager" in the menu
The list on the right shows "partially installed" for API level 25
Click "Edit" on the right of "Android SDK Location"
You get the warning "an existing Android SDK was detected wizard will only download missing or outdated SDK components"
Click "Next"
Click "Next"
[wait while it installs]
Click "Finish"
I got this problem since hours on my Apple M1 processor.
After a clean delete of Android SDK, this workaround worked for me: https://stackoverflow.com/a/69868954/6809733
Just download the IDE - Intellij IDEA and create a new project, select
Android Project and there download Android SDK, now you can install
android studio again and the sdk is installed. Worked for me!
Just delete the directory C:/Users/%user%/AppData/Local/Android/sdk and rename the other directory in that location from sdk1 to sdk.
Restart Android Studio (close projects) and an assistant will pop-up asking you to update the sdk which will be detected during that process, so a re-download won't be necessary.

I can't open Android Device Monitor

I am using Android Studio. I can't open Android Device Monitor, Tools > Android > Android Device Monitor. I occurred an error. See the log file at:
C:\Users\Peter Phyo\AppData\Local\Android\sdk\tools\lib\monitor-x86\configuration\1433318221838.log.
Do you have JAVA_HOME in your system environment variables?
JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11
Run android studio as administrator. It will definitely work. No need to reinstall neither android studio nor java.
In my case, after upgrading Android Studio 3.1.2, I tried open C:\Users\yourUserName\AppData\Local\Android\Sdk\tools\monitor, Windows alert "can't find 'lib\monitor-location'. Make sure you typed the name correctly, and then try again". Then I tried open tools\lib\monitor-x86_64\monitor, it works!
I'm on Windows and open Android Studio in Administrative Mode (Run as administrator). Worked for me.
I had the same problem, i solved it using jPortable, if you're using Windows then take this one, there are two versions 32bits and 64bits : https://portableapps.com/apps/utilities/java_portable I changed the location for the extraction from C:\SDK\tools\lib\monitor-x86_64\CommonFiles\Java64 to C:\SDK\tools\lib\monitor-x86_64\jre and it worked.
You need to set path to your ..jre\bin location :
Check in: File > Project Structure your JDK location
add the \bin there , my path is : C:\Program Files\Android\Android Studio\jre\bin
set the path in your Environment Variables, for WINDOWS 7 :
the From the desktop, right click the Computer icon.
Choose Properties from the context menu.
Click the Advanced system settings link.
Click Environment Variables
New System Variable
set the path the following way :
Variable name: Path
Variable value: your path
in my case: Variable value: C:\Program Files\Android\Android Studio\jre\bin
Now you can start the Monitor.exe, my location is here : C:\Users\Admin\AppData\Local\Android\Sdk\tools\lib\monitor-x86_64
for WIN7 32bit start the Monitor.exe from
...Android\Sdk\tools\lib\monitor-x86
Make sure have installed JDK7 or JDK8 depending on your OS bits
If you are using 32bits your install JDK7 or 8 of 32bits
After you install JDK, your JAVA_HOME in your system will be located in
C:\Program Files\Java\jdk1.8.0_40
To check if your JAVA_HOME is set, CLICK Start Menu > Computer > Right Click on Computer > Properties > Control Panel Home will appear, > click Advanced System Settings, under > Advanced Tab click > Environment Variables and check on the > System Variables for > Path if Java [C:\ProgramData\Oracle\Java\javapath;] is there, than you are good to go.
Make sure you have your JAVA_HOME in your system environment variables.
Hope this well help you. If it helped you, please mark it, so that it can the useful to others.
Please ensure you have Android SDK Tools installed.
I had a fresh copy of Android Studio and kept getting this error.
To install:
Tools -> Android -> SDK Manager -> SDK Tools (tab) -> Tick Android SDK Tools x.x.x (if it's not installed) -> Apply
Once installed / finished, try restarting Android Studio then selecting Android Device Monitor from the Tools drop down again.
If you want to see file explorer the please go from this path
View -> Tool Windows -> Device File Explorer.
I hope this path solve your problem.

Android Studio Beta v0.8.14 not showing in start menu

I have downloaded Android Studio Beta v0.8.14 and followed the steps to install it on Windows 7 from the link:
https://developer.android.com/sdk/installing/index.html?pkg=studio
The link says to launch studio.exe and follow the installation wizard. But the zip file contains studio.exe file in bin folder and directly launches Android Studio(after resolving all issues). There is no installation wizard and so it is not showing up in start menu. I don't have any others problems though but just want to make sure that everything is all right.
Am I missing something?
Android studio doesn't have an installer. you just unzip the file and its ready to go. You are not missing anything.
However, if you want to you can adda start menu shortcut for the .exe file if you want, that doesn't have an installer.

Resources