My favorites | Sign in
Project Home Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 82: The android:pull goal always fails the build.
3 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Sep 2010


Sign in to add a comment
 
Reported by tiggerizzy, Aug 13, 2010
What steps will reproduce the problem?
1. Perform a mvn android:pull from an already running device

What is the expected output?
	[INFO] ------------------------------------------------------------------------
	[INFO] Building Project
	[INFO]    task-segment: [android:pull] (aggregator-style)
	[INFO] ------------------------------------------------------------------------
	[INFO] adb [-s, localhost:56010, pull, /data/data/project/files, /$workspace/target]
	[ERROR] pull: building file list...
	[ERROR] pull: /data/data/project/files/TEST-all.xml -> /$workspace/target/TEST-all.xml
	[ERROR] 1 file pulled. 0 files skipped.
	[ERROR] 1 KB/s (214 bytes in 0.153s)
	[INFO] 
	[INFO] ------------------------------------------------------------------------
	[INFO] BUILD SUCCESSFUL
	[INFO] ------------------------------------------------------------------------
	[INFO] Total time: 
	[INFO] Finished at: 
	[INFO] Final Memory: 
	[INFO] ------------------------------------------------------------------------


What do you see instead?
	[INFO] ------------------------------------------------------------------------
	[INFO] Building Project
	[INFO]    task-segment: [android:pull] (aggregator-style)
	[INFO] ------------------------------------------------------------------------
	[INFO] adb [-s, localhost:56010, pull, /data/data/project/files, /$workspace/target]
	[ERROR] pull: building file list...
	[ERROR] pull: /data/data/project/files/TEST-all.xml -> /$workspace/target/TEST-all.xml
	[ERROR] 1 file pulled. 0 files skipped.
	[ERROR] 1 KB/s (214 bytes in 0.154s)
	[INFO] ------------------------------------------------------------------------
	[ERROR] BUILD ERROR
	[INFO] ------------------------------------------------------------------------
	[INFO] Pull failed.

	Embedded error: ANDROID-040-001: Could not execute: Command = /bin/sh -c adb -s localhost:55959 pull /data/data/project/files '/$workspace/target', Result = 0
	[INFO] ------------------------------------------------------------------------
	[INFO] For more information, run Maven with the -e switch
	[INFO] ------------------------------------------------------------------------
	[INFO] Total time: 2 minutes 15 seconds
	[INFO] Finished at: Fri Aug 13 14:56:41 UTC 2010
	[INFO] Final Memory: 46M/82M
	[INFO] ------------------------------------------------------------------------

What version of maven-android-plugin are you using?
2.5.3-SNAPSHOT

Please provide any additional information below.
This is related to  Issue 58  in that the command executor is checking to see if there was any error output and failing the build because of it. The quick and dirty workaround for those that come across this is to modify the call to executeCommand in PullMojo from executor.executeCommand("adb", commands); to executor.executeCommand("adb", commands, null, false);. This also likely applies to the android:push goal.

Aug 13, 2010
#1 tiggerizzy
I also meant to point out if it was not apparent from the output that the pull transfer did take place and was successful.

Lastly, I added a 
    logger.info("This is stdErr:" + stdErr.toString());

right before the check for stdErr.hasError() in CommandExecutor and here is the output:
    [INFO] This is stdErr: pull: building file list...pull: /data/data/project/files/TEST-all.xml -> /workspace/projectt/target/TEST-all.xml1 file pulled. 0 files skipped.1 KB/s (214 bytes in 0.155s)

So as I though there was no error and  Issue 58  is really the root cause.
Sep 25, 2010
#2 hugo.josefson.old@gmail.com
Thanks. Unfortunately many android tools behave this way, that they print normal output on STDERR. We'll have to parse it by hand.
Status: Accepted
Labels: -Priority-Medium Priority-High
Sep 25, 2010
#3 hugo.josefson.old@gmail.com
 Issue 65  has been merged into this issue.
Sep 26, 2010
#4 hugo.josefson.old@gmail.com
Released maven-android-plugin 2.6.0 with a patch which resolves the issue as stated in the title, which is that the build now no longer fails. It succeeds every time (even if the pull/push fails.)
Getting rid of the false positives would be a separate issue.
Status: Verified
Labels: Milestone-2.6.0
Jul 18, 2011
Project Member #5 mosa...@gmail.com
Pull and push have been refactored for 3.0 and work fine now.
Status: Fixed
Sign in to add a comment

Powered by Google Project Hosting