Checking if an update is available
Update not available
Starting Node Server
info: Welcome to Appium v1.3.7 (REV 72fbfaa116d3d9f6a862600ee99cf02f6d0e2182)
info: Appium REST http interface listener started on 127.0.0.1:4723
info: [debug] Non-default server args: {“app”:“D:\apk\Calculator.apk”,“address”:“127.0.0.1”,“logNoColors”:true,“deviceName”:“emulator-5554”,“platformName”:“Android”,“platformVersion”:“18”,“automationName”:“Appium”}
info: Console LogLevel: debug
info: → POST /wd/hub/session {“desiredCapabilities”:{“appPath”:“D:\apk\Calculator.apk”,“platformVersion”:“4.4”,“platformName”:“Android”,“deviceName”:“tt”,“appActivity”:“com.android.calculator2.Calculator”,“appPackage”:“com.android.calculator2”}}
info: Client User-Agent string: Apache-HttpClient/4.3.2 (java 1.5)
info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : appPath
error: Failed to start an Appium session, err was: Error: ‘java -version’ failed. Error: spawn ENOENT
info: [debug] Using local app from command line: D:\apk\Calculator.apk
info: [debug] Creating new appium session fb45c483-63bb-4776-bf90-440fa066f539
info: Starting android appium
info: [debug] Getting Java version
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Error: ‘java -version’ failed. Error: spawn ENOENT
at C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android-common.js:1032:17
at exithandler (child_process.js:633:7)
at ChildProcess.errorhandler (child_process.js:649:5)
at ChildProcess.EventEmitter.emit (events.js:95:17)
at Process.ChildProcess._handle.onexit (child_process.js:795:12)
info: [debug] Responding to client with error: {“status”:33,“value”:{“message”:“A new session could not be created. (Original error: ‘java -version’ failed. Error: spawn ENOENT)”,“origValue”:“‘java -version’ failed. Error: spawn ENOENT”},“sessionId”:null}
info: ← POST /wd/hub/session 500 13.133 ms - 208
i got this one… i think you are using java 1.5 version… which is not compatible with Appium… Please install java latest version 8 which is very much compatible with Appium. Please let me know the status.
The same error i got previously…In my case i was using build.xml for compilation.so in that i had java version as 1.8.x , but in my PC it was 1.7.x …so i made a change for java version to 1.7.x in build.xml , got resolved.
Sorry I haven’t mentioned it… u have Installed JRE system Library [jdk1.8.0_20] (java development Kit) but for me I have add JRE System Library[jre1.8.0_45] (java Run time environment)… Please check it once.
Adding system32 location “%SystemRoot%\system32” as PATH variable under System variables will resolve the issue because basically appium might need something from system32 directory to interact with adb command during run time.
I have set the desired capabilities in my code but when i execute it, the app closes as soon as it launches hence all my test fails. I have attached the screenshot of the terminal. It is taking force-stop as one of the arguments which i am not passing anywhere in my code. Please see my screenshot and share a solution. TIA.
I got same kind of issue Not able to run Appium program {“message”:”A new session could not be created. (Original error: ‘java -version’ failed
My environment
Jdk jdk1.8.0_101 and JRE 1.8.0_101
Classpath set properly
Eclipse Kepler Service Release 2 with JDK1.8 support
I observed that Java comment gives Error to initialization of VM (java/lang/NoClassDefFoundError: java/lang/Object)
Solution:
Uninstall all Java packages of all versions.(Uninstalled JRE and JDK completely)
Download last packages Java SE or JRE for your 32 or 64 Windows and install it.
First install JRE and second is Java SE( Installed JRE 1.8 then Installed JDK 1.8)
Set Classpath check Java coomand works or not and its working also able to execute the Appium program