gojuno/swarmer

Unable to create and start an emulator

Closed this issue · 3 comments

I am unable to create an emulator. I have Android SDK Tools 25.2.3 downloaded and installed system-images;android-25;google_apis;x86 as well. Any pointers would be super helpful. Details Below

Code I am running

#!/usr/bin/env bash
 
SWARMER_VERSION=0.1.0
 curl --fail --location https://jcenter.bintray.com/com/gojuno/swarmer/swarmer/${SWARMER_VERSION}/swarmer-${SWARMER_VERSION}.jar --output /tmp/swarmer.jar
 
 java -jar /tmp/swarmer.jar \
 --emulator-name test_emulator_1 \
 --package "system-images;android-25;google_apis;x86" \
 --android-abi google_apis/x86_64 \
 --path-to-config-ini emulator_config.ini \
 --emulator-start-options -prop persist.sys.language=en -prop persist.sys.country=US \
 --redirect-logcat-to test_emulator_1_logcat.txt

Main Error Message

Cannot run program "/usr/local/android-sdk/tools/bin/avdmanager": error=2, No such file or directory

Full Stacktrace

[Mon Jun 26 19:32:16 UTC 2017]: Error during creation of avd test_emulator_1, error = rx.exceptions.CompositeException: 1 exceptions occurred.
[Mon Jun 26 19:32:16 UTC 2017]: Error during creation of avd test_emulator_1, error = rx.exceptions.CompositeException: 1 exceptions occurred.
[Mon Jun 26 19:32:16 UTC 2017]: Error during creation of avd test_emulator_1, error = rx.exceptions.CompositeException: 1 exceptions occurred.
[Mon Jun 26 19:32:16 UTC 2017]: Could not create avd test_emulator_1, error = rx.exceptions.CompositeException: 1 exceptions occurred.
Exception in thread "main" rx.exceptions.CompositeException: 1 exceptions occurred.
	at rx.internal.operators.OperatorMerge$MergeSubscriber.reportError(OperatorMerge.java:268)
	at rx.internal.operators.OperatorMerge$MergeSubscriber.checkTerminate(OperatorMerge.java:818)
	at rx.internal.operators.OperatorMerge$MergeSubscriber.emitLoop(OperatorMerge.java:579)
	at rx.internal.operators.OperatorMerge$MergeSubscriber.emit(OperatorMerge.java:568)
	at rx.internal.operators.OperatorMerge$InnerSubscriber.onError(OperatorMerge.java:852)
	at rx.internal.operators.OnSubscribeMap$MapSubscriber.onError(OnSubscribeMap.java:88)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.checkTerminated(OperatorObserveOn.java:273)
	at rx.internal.operators.OperatorObserveOn$ObserveOnSubscriber.call(OperatorObserveOn.java:216)
	at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
	at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at java.lang.Thread.run(Thread.java:748)
  ComposedException 1 :
	java.io.IOException: Cannot run program "/usr/local/android-sdk/tools/bin/avdmanager": error=2, No such file or directory
		at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
		at com.gojuno.cmd.common.ProcessesKt$process$1.call(Processes.kt:69)
		at com.gojuno.cmd.common.ProcessesKt$process$1.call(Processes.kt)
		at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:72)
		at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:32)
		at rx.Observable.unsafeSubscribe(Observable.java:10346)
		at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
		at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
		at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
		at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
		at java.lang.Thread.run(Thread.java:748)
	Caused by: java.io.IOException: error=2, No such file or directory
		at java.lang.UNIXProcess.forkAndExec(Native Method)
		at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
		at java.lang.ProcessImpl.start(ProcessImpl.java:134)
		at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
		at com.gojuno.cmd.common.ProcessesKt$process$1.call(Processes.kt:69)
		at com.gojuno.cmd.common.ProcessesKt$process$1.call(Processes.kt)
		at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:72)
		at rx.internal.operators.OnSubscribeCreate.call(OnSubscribeCreate.java:32)
		at rx.Observable.unsafeSubscribe(Observable.java:10346)
		at rx.internal.operators.OperatorSubscribeOn$SubscribeOnSubscriber.call(OperatorSubscribeOn.java:100)
		at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:230)
		at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
		at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
		at java.util.concurrent.FutureTask.run(FutureTask.java:266)
		at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
		at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
		at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
		at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
		at java.lang.Thread.run(Thread.java:748)

As I see it avdmanager is located at the tools package and available since revision 26.0.0. Please try to update it if it is outdated.

@ming13 thanks. that seemed to do the trick. Do you mind updating the README to reflect this.