Maven Sample Android App deploy fails constantly after one successful run - android

I downloaded the examples from simpligility.github.io/android-maven-plugin and did a mvn clean package android:deploy on the helloflashlight example.
After setting adbConnectionTimeout to 15000 everything went fine for one run. I deployed the app sucessfully - the app started on my device and I was able to push the color buttons.
After that I ran mvn android:undeploy to clean the device. Now I am not able to deploy this test app again. Maven says FAILURE "E/Device: Error during Sync: Eine vorhandene Verbindung wurde vom Remotehost geschlossen" Which means an open connection was closed by remote host(?).
I googled and found out that the problem may be 2 processes of adb.exe starting during deploy. So I entered adb kill-server and shut the adb down.
Still on each deploy 2 adb.exe are starting, one is shutting down immediatly, the other stays open. Searching for adb.exe at my computer only finds one adb.exe.
Does anybody have some hints for me?
My system setup:
I installed Eclipse with current ADT (Android Deploment Tools).
I used the Android SDK Manager to download and install android sdk and tools into C:\users\me\android-sdk. I added a samsung device to the device list which is displayed when I enter adb devices
After that I configured Maven for android - setting ANDROID_HOME and added %ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools to my PATH.
I am working with Windows 7 64-bit.

It seemed to be a problem with the device. I switch to another device of same type... no problems any more.

Related

Open Android Device in Genymotion from Expo XDE gives error

I am using Expo XDE version 16.0.0 and I would like to test my app in the Android emulator. I am on a mac. I have installed Genymotion and have started the emulator as the expo.io (https://docs.expo.io/versions/v16.0.0/guides/genymotion.html) docs describes but I get the following error. I have no idea of what it means or how to fix it.
Couldn't start project on Android: could not install smartsocket. listener: Address already in use ADB server didn't ACK * failed to start daemon * error: cannot connect to daemon
I hope someone can help me on this one?
In my case the solution was this on an Ubuntu 17.04
sudo apt remove android-tools-adb
adb kill-server
adb start-server
it's possible you have adb and android-tools-adb installed
After having spent a day figuring it out, I decided to go with using the Android emulation within genymotion. This is for Ubuntu (16.04).
Download Android Studio & go into Tools > Android > AVD Manager.
Download the SDK for whichever device & Android version you are going
to use.
Once downloaded, test the emulator is functional by clicking
on the green play icon under 'actions' (far right in Virtual Devices
screen).
Open genymotion, settings > ADB > 'use custom Android SDK
tools'. Select folder /*/Android/Sdk (wherever Android sdk is
installed)
Test by clicking on 'Start' in main genymotion screen.
Open Expo XDE, load up the project & 'ctrl+d' to load on android
device. It will start the installation of expo app.
vividresponse here worked for me even on linux (he made it on OSX and I see it works for windows too).
Basically, you must check the versions of adb. Like:
adb version
And (using you real path)
/opt/android-sdk/platform-tools/adb version
If they differ, replace /usr/bin/adb (first one) with the second one.
Other important things are that you must set the correct genymotion SDK. And make sure sdk & sdk tools must be present in the PATH variable.

adb socket not working and daemon

I am getting this type of error
error: could not install smartsocket listener: cannot bind to
127.0.0.1:5037: Only one usage of each socket address (protocol/network address/port) is normally permitted. (10048) 1:34:26
PM could not read ok from ADB Server 1:34:26 PM * failed to start
daemon * 1:34:26 PM error: cannot connect to daemon 1:34:26 PM
'C:\Users\MITESH
SUTHAR\AppData\Local\Android\Sdk\platform-tools\adb.exe,start-server'
failed -- run manually if necessary 1:38:14 PM Unable to obtain result
of 'adb version'
my genymotion device is running but it shows me that no device
I came across the same error. I provided the below command and the issue got solved.
COMMAND :- taskkill /f /im adb.exe
Close Eclipse or Android Studio if either is running (Optional).
Open Command Prompt.
Go to the Android SDK platform-tools directory.
Type adb kill-server.
Type adb start-server.
If no error message is thrown while starting ADB server, then adb is started successfully.
OR
Go to Task Manager, open the Processes tab, and end the adb.exe process.
Then restart Android Studio.
This may work if there is any problem with adb.
In my case, none of the above solution worked. I solved it strangely maybe it can be a bug.
Do not run Genymotion emulator before Android Studio. Firstly, I opened android studio then I clicked run project and select deployment target windows appeared. Then I run genymotion emulator and now the emulator is shown in the select deployment target windows in Android Studio. Then deployed to the emulator without errors. Done!
As another way, you can try to set Genymotion sdk to the same as Android studio sdk. To do this, first find your sdk location. You can find it by right clicking the Android Studio project -> Open Module Settings-> Select SDK location -> under Android SDK location, it is shown. Then open Genymotion -> Settings -> ADB tab -> Click Use custom Android SDK tools radio button -> navigate to SDK folder used by Android studio -> Restart Genymotion virtual device
If none of the above worked for you, just make sure that you have closed Genymotion emulator as it caused this issue with me.
Easiest Way! I just ran into this issue trying to connect a React-Native App to an Android Studio emulator. If you read the error message it tells you that "Only one usage of each socket address (protocol/network address/port) is normally permitted." So you can assume that something other than React-Native is also attempting to connect to the emulator.
Terminate The Connections:
Leave the emulator running.
Close out of and uninstall any Android Studio/Eclipse Apps you have on the emulator. This terminates apps trying to connect.
Close Eclipse or Android Studio if either are running. Android Studio doesn't have to be open in order for the emulator to work (This is important). This terminates software trying to connect.
After doing so I went back into my React-Native App and connected to Expo no problem.
All you have to do is terminate all connections. However you so choose.
I came across the same error, it worked simply after restarting the AS on windows, of course, it asked for SDK update.
Android Studio 4.1.3 with API 30 installation has this error
01-04-2021
09:56 'C:\Users\ranja\Android\Sdk\platform-tools\adb.exe start-server' failed -- run manually if necessary
Tried C:\Users\ranja>adb start-server
daemon not running; starting now at tcp:5037
**could not read ok from ADB Server
failed to start daemon
error: cannot connect to daemon**
Note: I have added 'C:\Users\ranja\Android\Sdk\platform-tools' in %PATH% environment variable on Windows 10
i've encountered same error in my ionic 2. i just uninstall and reinstall ionic. and it works fine again..
npm uninstall -g ionic
npm install -g ionic

error "The connection to adb is down" when run an android app

I'm new with android development, and I have problems installing all the recent platform. I'm a java developer that I would like learning android.
I've installed all programs succesfully in windows xp sp3 (JDK 1.6 with environment vars created, eclipse 3.5, 3.6 & 3.7 well configured, Android SDK with all the features, devices, platform-tools, APi's, etc, and ADT Plugin 12 for eclipse with an emulator to API 8 -Target 2.2-), but, when I'm running an android project into eclipse (Run -> Android Application), the eclipse console show me: "The connection to adb is down, and a severe error has ocurred... You must restart adb and eclipse... Ensure that adb is in this path 'D:\Android\android-sdk-windows\platform-tools\adb.exe'" (or something similiar).
I'm very sure that the path is right, adb is correctly running on command-line, and the commands 'adb kill-server' and 'adb start-server' works fine, but doesn't solve my problem (like I've read in other answers).
The emulator, via Eclipse, not working, but if I start the emulator via Eclipse ADV Manager, emulator starts fine, but when I runs the android app, I take the same error.
I suppose that Eclipse can't start adb,but I don't know why.
Other issue, when I executed 'adb devices', console show me an empty list, no 'no devices' message, but when I plugged my HTC, adb is running fine in console, but Eclipse doesn't.
In addition, I also try restarting adb with Eclipse - Devices tab, but the list of devices are empty too.
Anyone can help me, please? I've read so much that my eyes are pixelated. xD
Best regards!!
PD: sorry, but my english is a bit poor ;)
in the DDMS perspective (if it doesn't show, add it by click window>open perspective>other...>DDMS)
then click the triangle of the devices tab > reset adb.
this works for me.
I finally resolved the problem, please see my blog
you can do this steps to solve the problem:
task manager-> process
right click on adb.exe and left click on "properties"
check the path of the process:
-if the path is like "Programs\android-sdk\platform-tools", which means it is the android sdk that is running this process.
-if not, that means there is another process this is running adb.exe, you have to kill the process or service which runs adb.exe.(you can identify the process by the path)
I've had this problem too. The solution I've found is to kill eclipse, open up task manager and kill the adb.exe process. Then when you start eclipse again, that should also kick start adb and it should work from there.
Try the following steps :
- Close Eclipse IDE
- Go to the Android SDK platform-tools directory in Command Prompt
- run adb kill-server
- run adb start-server
- Now start Eclipse again.
Hope this may help you :)
In my case, in Windows7
Close all opened emulators
Go to task manager > processes and then click on adb.exe and press the button 'end process'.
Then go to command prompt go to plate-form tools and type
adb start-server
Then run your application through eclipse.
It worked fine for me.
you try
Open Task Manager > Processes > eclipse.exe > End Process > restart eclipse
In my case the problem was the FIREWALL!.Turn off your windows firewall , Then restart adb and eclipse from task-manager

Android adb.exe crashes - Only when called from Eclipse (win7 32)

ADB when run stand-alone works fine. I can connect to my device (HTC Desire) and perform .apk installs etc, so I know the USB drivers are working correctly. A common reason for this question, I know, but that can be ruled out.
Occasionally I can connect to the phone, very occasionally. 99% of the time I just get the standard windows popup "adb.exe has stopped working".
I've updated Eclipse to the latest version.
I'm sure the USB drivers are working correctly
I can connect via adb in command line mode with no issues.
I've searched for a solution until google begged me to stop :)
Seems like a DDMS Eclipse issue.
Any ideas ?
Actually, just before I sent this I had a brainwave.
Without Eclipse running I ran adb.exe from command line and performed an install -r of my .apk package.
All worked fine.
I then started Eclipse - the connection to my phone worked fine...
Nope, Eclipse now failing again. BUT with eclipse trying to connect (and failing) I can simultaneously run adb from command line and install the package. It's got to be Eclipse
If you have an alternate "launcher" or "home-screen" installed, that might be forcing the connection to close. If you have one installed, either force stop it or uninstall it.
I've found that some apps running in your phone can cause ADB to crash for some reason. Try to close unnessecary apps running on your phone when developing in eclipse
In my case, I had an instance of adb.exe from another package (Android-Sync) running. Processes with this file name are common in packages that sync devices. You can find more information about programs that use an adb.exe process here: What is adb.exe ? adb.exe info
To determine if you have an adb.exe process already running, look in your Task Manager on the Processes tab to find the running adb.exe. You can right-click and select Properties from the menu to find out the full path of the adb.exe.
To solve the problem and allow Eclipse access to the correct adb.exe, I shut down Eclipse and the emulator. Then I went into the Task Manager and shut down the running adb.exe. There may be more than one. Then I restarted Eclipse and the emulator. Fortunately, when I started my Android Virtual Device, that program was smart enough to start up the correct adb.exe.
In my case was kinda problem with USB driver. Just plug your phone always to the same USB port.

Android Emulator won't run application started from eclipse

I have followed the "Hello World" example from Google's Android developer's guide. When I try to run the application in the SDK emulator, nothing happens. The emulator startd up nicely, but after that nothing happens. I can't even see the application in the app tray.
I am using Eclipse with the Android add-on installed.
Had the same problem, the console log stalled after:
Launching a new emulator with Virtual Device
and the emulator never showed the HelloAndroid application. I finally figured it out!
In Eclipse go to
Run --> Run Configurations
Then change the Launch Action for your application (e.g. HelloAndroid) from "Launch Default Activity" to "Launch:" and then select your application from the pull-down menu. This did the trick for me.
HTH,
Sven
Same here; emulator loads fine but apk doesn't get installed. Problem is only with the emulator. All works fine if physically connecting a device with USB debugging turned on.
NB This suddenly started happening for no apparent reason. All used to work fine.
I've tried uninstalling and reinstalling the ADT Plugin and I've updated the Android SDK and AVD Manager to the latest available. (Tools revision 7) but the problem continues.
Eclipse: Helios Service Release 1
Build id: 20100917-0705
Running on Windows XP SP2
Just as others have posted, the console log shows
[2010-10-14 11:39:33 - uad-MediaPlayerExample] ------------------------------
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Android Launch!
[2010-10-14 11:39:33 - uad-MediaPlayerExample] adb is running normally.
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Performing com.msi.manning.chapter10.MediaPlayerExample.MediaPlayerActvity activity launch
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Automatic Target Mode: launching new emulator with compatible AVD '1.6-hvga'
[2010-10-14 11:39:33 - uad-MediaPlayerExample] Launching a new emulator with Virtual Device '1.6-hvga'
LogCat remains empty/blank.
And if I then try to re-run the same app, the console shows:
[2010-10-14 11:39:33 - Emulator] emulator: ERROR: the user data image is used by another emulator. aborting
POSSIBLE ANSWER???
One solution seems to be to kill the adb.exe process in Windows Task Manager (while the emulator is still running).
(from http://vikashazrati.wordpress.com/2008/01/01/quicktip-android-does-not-load-my-application-in-the-emulator/)
The console suddenly shows lots of errors:
[2010-10-14 12:12:00 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:01 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:01 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:02 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:02 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:03 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:03 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:04 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:04 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:05 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:05 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
[2010-10-14 12:12:06 - DeviceMonitor]Sending Tracking request failed!
[2010-10-14 12:12:06 - DeviceMonitor]Adb connection Error:An existing connection was forcibly closed by the remote host
but the app starts in the emulator. !!!
(as expected the LogCat also suddenly starts to display lots of messages)
All works fine - i.e. you can work on your code and re-run the app in the same emulator and it reinstalls as expected...
BUT if you close the emulator, you see the following console error:
[2010-10-14 12:15:05 - DeviceMonitor]Sending jdwp tracking request failed!
And the same problem reoccurs - a new emulator appears but the apk isn't installed. So you need to go back to Windows Task Manager and once again kill the adb.exe process.
NB I find that adb.exe doesn't reappear in the Task Manager unless I restart Eclipse, so after closing an emulator you have to restart Eclipse, try Run (which fails to display the app) then go back to the Task Manager where adb.exe is once again listed and kill the process for the app to start.
Would be great if someone could provide an explanation for this and a permanent fix...
I have the similar problem. I suggest the following workaround:
close eclipse, in the Task Manager, kill all adb and emulator* processes.
start eclipse, run your application, wait untill the emulator starts. If you have the problem, your application won't be started, there will be the bare emulator.
In eclipse, select Window->Open Perspective->Other->DDMS. Switch to DDMS perspective. If you have the problem, the list of the devices will be empty.
In the Devices tab, in the drop-down box, select "reset adb". In a short while, the emulator must appear in the devices list.
Following that, switch back to your Java perspective and run your app. Everything must work fine for the rest of the session.
Actually, if you are using Windows, the problem might be that the User Account Control in your Windows is preventing Eclipse to load the apk in the emulator (Eclipse doesn't have right to do so).
To turn off the User Account Control, go to the Control Panel, click User Accounts and Family Safety, and then click User Accounts. Once there, click the option 'Turn User Account Control on or off'.
Depending on your computer it can takes several minutes to load the emulator and the app. Open Logcat view to see the progress of loading.
Same problem. Killing adb from task manager didn't help. Also tried restarting the AVD using android create avd --target 2 --name my_avd --force, no good. Tried the different launch method in Eclipse, nada.
What eventually helped is: I started (from the start menu, not command line) the Android SDK Tools > SDK Manager, found the my_avd under virtual devices, and simply clicked the Start... button. That did it - the emulator started, I ran from Eclipse, and it immediately showed the app on the emulator.
One solution is go to android sdk/tools directory and start ddms.bat for Dalvik Debug Monitor, then select Actions->Reset adb. That seem to fix the problem
In my case the problem occurs because of the simple thing: i do not select the project that i want to run. Click on it in solution folder, then press run and enjoy. Hope it will help someone.
The Android emulator takes approximately 1 to 2 mins to load. Check the console tab in the eclipse IDE for evaluating the progress of loading the emulator and installing the application in the emulator.
I used to face this problem a lot. There is workaround for this,
End the "adb.exe" process from the Task Manager and try again.
It should work.
and instead of running from eclipse i use following batch files in my project directory to install and uninstall the apk. Those work great.
Install.bat
cd bin
adb install *.apk
Uninstall.bat
adb uninstall this.is.package.name
STEPS TO FOLLOW:
Go to Command Prompt
type adb kill-server
enter
Now it should work fine
For me the solution was to choose "app" instead of "RSSReader" (my project name) in the dropdown next to the AVD tray. When I choose "RSSReader", the AVD is greyed out and unusable.
This leads me to wonder if my project is setup wrong or if "app" is the correct state.

Categories

Resources