Unable to pre launch the application

I am trying to pre launch the android application in the android emulator (Launched using Genymotion) , but i receive the following error in the Appium Log. Can someone help me to solve this issue,

info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing: “D:\android-sdks\platform-tools\adb.exe” -s shell “getprop ro.build.version.sdk”
info: [debug] Device is at API Level 18
info: Device API level is: 18
info: [debug] executing: “D:\android-sdks\platform-tools\adb.exe” -s shell “getprop persist.sys.language”
info: [debug] Current device language:
info: [debug] java -jar “D:\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\Vignesh\Desktop\MyDigitalDashboard_v4.2.apk” “C:\Windows\Temp\com.bt.mdd”
info: [debug] No strings.xml for language ‘’, getting default strings.xml
info: [debug] java -jar “D:\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar” “stringsFromApk” “C:\Users\Vignesh\Desktop\MyDigitalDashboard_v4.2.apk” “C:\Windows\Temp\com.bt.mdd”
warn: Error getting strings.xml from apk
info: [debug] ‘java’ is not recognized as an internal or external command,
operable program or batch file.

info: [debug] executing: “D:\android-sdks\platform-tools\adb.exe” -s shell “echo ‘{}’ > /data/local/tmp/strings.json”
info: [debug] Checking whether aapt is present
info: [debug] Using aapt from D:\android-sdks\build-tools\19.0.0\aapt.exe
info: [debug] processFromManifest: “D:\android-sdks\build-tools\19.0.0\aapt.exe” dump xmltree “C:\Users\Vignesh\Desktop\MyDigitalDashboard_v4.2.apk” AndroidManifest.xml
info: [debug] Set app process to: com.bt.mdd
info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for C:\Users\Vignesh\Desktop\MyDigitalDashboard_v4.2.apk: java -jar “D:\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar” “C:\Users\Vignesh\Desktop\MyDigitalDashboard_v4.2.apk”
info: [debug] App not signed with debug cert.
info: [debug] Resigning apk with: java -jar “D:\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar” “C:\Users\Vignesh\Desktop\MyDigitalDashboard_v4.2.apk” --override
info: [debug] Stopping logcat capture
info: [debug] Logcat terminated with code null, signal SIGTERM
info: [debug] Sent shutdown command, waiting for UiAutomator to stop…
warn: UiAutomator did not shut down fast enough, calling it gone
error: Could not pre-launch appium: Error: Command failed: ‘java’ is not recognized as an internal or external command,
operable program or batch file.

Node Server Process Ended


This means that JAVA_HOME is not present in your environment variables, add it and it should work :smile:

Well , i have added C:\Program Files\Java\jdk1.7.0_05\bin; to the path in system variable. Isn’t that enough ?

should be changed to

C:\Program Files\Java\jdk1.7.0_05

Added “C:\Program Files\Java\jdk1.7.0_05;” to the path , still doesn’t work . Its still throwing the same error.

Restart the app in order for the new change to work :smile:

Still throws the same issue :smiley:

Open a cmd window and type “Java” and see what it happens?

This is the response i get.

Usage: java [-options] class [args…]
(to execute a class)
or java [-options] -jar jarfile [args…]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the “server” VM
-hotspot is a synonym for the “server” VM [deprecated]
The default VM is server.

-cp <class search path of directories and zip/jar files>
-classpath <class search path of directories and zip/jar files>
              A ; separated list of directories, JAR archives,
              and ZIP archives to search for class files.
              set a system property
              enable verbose output
-version      print product version and exit
              require the specified version to run
-showversion  print product version and continue
-jre-restrict-search | -no-jre-restrict-search
              include/exclude user private JREs in the version search
-? -help      print this help message
-X            print help on non-standard options
              enable assertions with specified granularity
              disable assertions with specified granularity
-esa | -enablesystemassertions
              enable system assertions
-dsa | -disablesystemassertions
              disable system assertions
              load native agent library <libname>, e.g. -agentlib:hprof
              see also, -agentlib:jdwp=help and -agentlib:hprof=help
              load native agent library by full pathname
              load Java programming language agent, see java.lang.instrument

              show splash screen with specified image

See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

Have you added ANDROID_HOME to your system variables??? Also have you added Android’s build-tools and platform-tools to your system variables too??

Yes , path to platform tools has been added in the path , then ANDROID_HOME has also been added.

Guess i need to add ANDROID_HOME to the path

I got it… had to add the ANDROID_HOME to the path.

1 Like

I have faced the same issue. Pls help me resolve this issue

@Hungo, what is the problem ?

Match your system and User variables as shown in the screenshot accordingly.Also add “C:\Program Files\Java\jdk1.7.0_05\bin;” to your path. i hope setting the path as given will solve your issue.