MAC - I can't open Android Device Monitor on Mac - android

I have opened it as an administrator and I don't want to install anything unnecessary.
When I tried to open Android Device Monitor through Android Studio: Tools > Android > Android Device Monitor. It always shows the following screen shot:
Screen shot that shows "An error has occurred"
I have found solutions for windows, but I did not find solutions for mac.
One piece from the log:
!ENTRY org.eclipse.osgi 4 0 2015-12-02 22:52:40.714
!MESSAGE Bundle reference:file:org.apache.lucene.core_2.9.1.v201101211721.jar#4 not found.
There are lots of similar lines like this showing "something not found".
So what is missing? How do I install the exact missing parts? Thanks! (There is no enough space for me to install everything from android studio.)

First of all update Android SDK Tools from SDK Manager
Open a terminal window
Navigate to your SDK
Locate the 'tools' folder
cd into it
run: sudo ./monitor
Type in your password
Hope it might solve your problem.

JPCS's solution worked for me; install Java 8 and then the Android Device Monitor will work:
First install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Then update and install Java 8
$ brew update
$ brew cask install java

I followed some steps and after long hours struggle all things got sort it out and i got success to run device moniter on Mac OS x.
what i did ?
I installed Homebrew and used its some commands to install java , because its so easy to download and install java in terminal using home-brew. its very good tool to sort out java problems automatically . but here one thing is to keep in mind . which is below ->
when you install java using Homebrew then please make sure you are using same version of java and jre with android studio.in my case my android studio using jre_1.8.0 , so installed java8.
Their some steps to follow.
just paste in terminal to download Homebrew to your system.
1.) /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
2.) $ brew tap caskroom/versions
$ brew cask install java8.
this will download and install java 8 automatically to your mac OSx.i installed java 8 for my case,java 9 is also available but i used java8. because i added jre 8 in my android studio compile path.so its required both in same version to aviod conflict.
3.) so once its installed, just restart your android studio and run device moniter from android studio.now you android studio will able to launch device moniter without any conflict.
Thank Happy coding :)

I had the same issue! Since I am not comfortable with using terminal, I just tried updating to the latest Java JDK and it seemed to fix the problem

Related

Which of the following android package is emulator

I am trying to setup react native without android studio by following this. Below are the packages that it asks me to install:
sudo /opt/android/tools/bin/sdkmanager "platform-tools" "platforms;android-28" "build-tools;28.0.3" "add-ons;addon-google_apis-google-24"
But the problem is that it is also downloading emulator, which I don't want because I would be running on a real device( It is large as well). I am unable to identify which of the above package is leading to installation of emulator.
Can you please help me so that emulator is not downloaded.
As I have checked for it by dedicating some time, I have found that installing build tools will install emulator as well.

How can I correctly set up UiAutomatorViewer to inspect elements for testing Android apps with Appium?

When running uiautomatorviewer, I am getting the following NullPointerException error:
I have installed and set up Appium following the setup process and set up environment variables for ANDROID_HOME and the Android SDK. The uiautomatorviewer command is using a Path user variable that points to the directory Sdk/tools/bin, where the uiautomatorviewer.bat file is located. From everything I've read online, running this executable should open up the UiAutomatorViewer application, so I can inspect elements on my Android app. Why isn't this working?
The correct fix for this issue:
Java SDKs 9 and 10 do not work with Appium and the Android SDK. You have to uninstall the Java SDK for the more recent version and install the Java 8 SDK instead.
For Linux
Follow this process:
brew cask uninstall java # uninstall java9
brew tap caskroom/versions
brew cask install java8 # install java8
touch ~/.android/repositories.cfg # without this file, error will occur on next step
brew cask install android-sdk
For Windows
Open Add or Remove Programs menu and uninstall Java 9/10.
Install Java 8 using the installer.
Can you just reconnect the device and restart it and the uiautomator? But make sure the test script is not running in the background. Or you can kill the adb server and restart it again.
You can go and check if you forgot any steps in UIAutomatorViewer Tutorial: Inspector for Android Testing.
I was using uiautomatorviewer with corretto-11.0.13 (after some edits in a .bat file) until I upgraded Android Studio to 2021.2.1 (Chipmunk) (to solve another issue in the Android build) and the problem didn't disappear. Moreover, more problems appeared. uiautomatorviewer didn't work again.
I rolled back to Android Studio 4.1.1, restored a change done in the find_java.bat file, and it worked again.
You must add the following Android/sdk/tools/bin/ in the system environment variable.
If you are using window os, you can do it like following:
Right-click on ‘This PC’ and select Properties.
Click 'Advanced system settings' and select ‘Environmental Variables’ option
Under the 'System variables", select 'Path' and click 'Edit'
Click 'New" and add the path of Android/sdk/tools/bin/ in the like
C:\Users\\AppData\Local\Android\Sdk\tools\bin
then you will be able to run uiautomatorviewer command in the command prompt.
The alternative way is to open command prompt in Android/sdk/tools/bin/ folder and then run uiautomatorviewer command.

Android Device Monitor not opening in Ubuntu 17.10

When I open Android Device monitor, I am getting the following error:
An error has occurred. See the log file
/home/omkar/Android/Sdk/tools/lib/monitor-x86_64/configuration/1509852867579.log.
I have already tried:
Running Android studio with "sudo"/ root user permission.
Reinstalling Android SDK.
My configuration :
Android Studio 3.0
Android SDK API version 27.
Ubuntu 17.10 Gnome
I am attaching the pastebin link for the logs in the question.
Logs Link : https://pastebin.com/cje8fkgY
While Android Studio brings its own Java version with it, the (now mostly deprecated) Android Device Monitor (ADM) is dependent on the Java version installed on your machine. From other error reports around the web, it seems that ADM needs Java 8 (here, for example). This is also where our machines differ from each other. As I noted in a comment above, I am, too, on Ubuntu 17.10, Android Sdk 27 and Android Studio 3.0, however, I have Java 8 installed, and ADM runs fine.
Therefore I would suggest you to add Java 8 to your machine and make it the default version. On Ubuntu, you can do this like that:
sudo add-apt-repository ppa:webupd8team/java // only necessary if repository not yet added
sudo apt-get update // only necessary if repository not yet added
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default
You need to set the default Java version. To do this follow below steps:
Run:
sudo update-java-alternatives --list
to list off all the Java installations on a machine by name and directory, and then run:
sudo update-java-alternatives --set [JDK/JRE name e.g. java-1.8.0-openjdk-amd64]
This worked perfectly for me.

Android SDK Issues Ubuntu 10.04lts

I have looked through the other questions on here, and on other forums. The answers didn't help my issue. I originally started out with 11.10 but thought there could be a bug or something that was stopping it from working. I have had the SDK and ADT working with Eclipse on both 10.04 and 11.10 so I really am at a loss as to what is going wrong.
The error I get is as follows:
Cannot complete the install because one or more required items could not be found.
Software being installed: Android Traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534)
Missing requirement: Android Traceview 16.0.1.v201112150204-238534 (com.android.ide.eclipse.traceview.feature.group 16.0.1.v201112150204-238534) requires 'org.eclipse.ui 3.6.2' but it could not be found
When I ran the SDK install a second time (after uninstalling it) I noticed the following error:
Stopping ADB server failed (code -1).
Unable to run 'adb': Cannot run program "/home/ben/android-sdk-linux/platform-tools/adb": java.io.IOException: error=2, No such file or directory.
Starting ADB server failed (code -1).
I didn't see it there the first time and I don't know what it means or how to fix it!
Any help would be greatly appreciated, the other 'answer' I found was from the same person who asked the question, that reinstalling everything corrected the problem, I have not been so fortunate so I thought I would re-raise the query. Thank you in advance. I am using Indigo as the version, I saw elsewhere that Helios was the lowest that could use the SDK.
Gone back to 11.10 but the issue remains the same, the laptop is a Samsung R580 64bit.
Preparing to install archives
Downloading Android SDK Platform-tools, revision 10
Installing Android SDK Platform-tools, revision 10
Stopping ADB server failed (code -1).
Still appears when installing the SDK Tools using the following command from terminal:
android-sdk-linux/tools/android
You're problem is entirely different than the one posted by robertly, although I'm sure you've found it using google.
You're running 64bit ubuntu and forgot to run the following command.
apt-get install ia32-libs
The phones aren't 64bit, so there is no 64bit version of adb. You need the ia32-libs.
After this is done, open eclipse and go to
Windows -> Android SDK Manager
then, uninstall all the tools(under tools sub folder) and reinstall them.
You should no longer get the adb error.
Source:
http://developer.android.com/sdk/installing.html#troubleshooting
Solution #2 - I had to do this because sudo apt-get remove eclipse didn't remove it completely and it still cause errors. Doing all of this, combined with the step above solved my problem the other night.
Delete eclipse, android folders
sudo apt-get remove eclipse
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin
sudo update-alternatives --config java
Reinstall eclipse 3.7.1, android-sdk-linux folder
Proceed with normal installation.
Head on over here, it looks to be the same problem, but with a different package.
Eclipse Indigo - Cannot install Android ADT Plugin
This is assuming you haven't seen that yet. If you are still having problems, I can look into it further for you.

Failed to parse the output of 'adb version'

I'm using Ubuntu 11.10 and Eclipse for android developing. I've already made a new project, but it contains error:
Failed to parse the output of 'adb version'
I will be thankful if anyone have an idea how can I fix that?
Install Oracle JRE using PPA:
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get update
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts
Install ia32-libs from software center.
Two options to solve this problem on windows:
Option 1:
Close the eclipse, if it is running.
Run the command prompt.
Go to the tools location of the android sdk.
run 'adb kill-server'
then run 'adb start-server'.
start the eclipse.
Option 2:
Open the task manager.
kill the adb process.
start the eclipse.
Problem should be solved.
The official Android SDK only runs on i386 JVM, so you need to manually specify the i386 JVM on Eclipse.
First install the Sun(Oracle) 32-bit JVM. Here is a step-by-step on how to do this:
Add the JVM to Eclipse. Navigate:
Window > Preferences > Java > Installed JREs > Add
Put the location of the JVM. Probably will be /usr/lib/jvm/java7/ (my is /usr/lib/jvm/java-7-sun-1.7.0.01). The external libraries will be automatically added when you put the location of the JVM.
Set the Sun (Oracle) 32-bit JVM as default.
if you run eclipse immediately after installing your java JDK, the java virtual machine MIGHT not be properly started. you will receive this error code when launching eclipse.
first check if when you installed your JDK, you copied a script file
/etc/init.d/jexec
if you did, before you do anything fancy, reboot your machine so that jvm starts properly. if you didnt, please decompress your jdk rpm file and extract the contents properly and then reboot.
worked for me, i just had this problem while installing adt bundle (and java jdk) on a virgin install of ubuntu 12.04 on a 64bit machine.
Delete the platform tools and then re-install them from the SDK manager
Copy the sdk\platform-tools contents to sdk\tool
also you must have a JAVA_HOME env var pointing to your java location
ex. JAVA_HOME=C:\Program Files\Java\jdk1.7.0_21

Categories

Resources