Our test runs smoothly with Java-Cleint 4.1.2 (Appium - 1.6.5)
Now we upgrade it to Java-Client 5.0.1
When the code attempts to initiate the appium driver it fails with the bottom error log.
It says that the Java home wasn’t set properly however on the appium-doctor it seems fine & on the Java-Client 4.1.2 it works fine as well.
Any idea what we are missing?
This is The desired capabilities (is anything missing for Java-Client 5.0.1?)
DesiredCapabilities capabilities = DesiredCapabilities.android();
capabilities.setCapability(MobileCapabilityType.APP, genMeth.getValueFromPropFile(“appPath”));
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, genMeth.getValueFromPropFile(“deviceName”));
capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 1200);
capabilities.setCapability(“automationName”,“uiautomator2”);
[RemoteTestNG] revisions:
git.commit.id=4f29d2b
git.branch=4f29d2b4f03d98ec727e1941758af66ae27e0458
git.build.version=1.2.0
[RemoteTestNG] detected TestNG version 6.9.9
[RemoteTestNG] Invoked with -serport 52344 -protocol json -d /Users/menypeled/Documents/workspace/Droid_Appium/test-output /Users/menypeled/Documents/workspace/Droid_Appium/src/resources/Testng.xml
[BaseMessageSender] Waiting for Eclipse client on localhost:52344
[BaseMessageSender] Received a connection from Eclipse on localhost:52344
[BaseMessageSender] Connection established, starting reader thread
[BaseMessageSender] ReaderThread waiting for an admin message
[JsonMessageSender] Sending message [GenericMessage ==> suiteCount:1, testCount:1]
[BaseMessageSender] ReaderThread received admin message:>ACK
[BaseMessageSender] Received ACK:>ACK
[BaseMessageSender] Received ACK:>ACK
[TestNG] Running:
/Users/menypeled/Documents/workspace/Droid_Appium/src/resources/Testng.xml
[JsonMessageSender] Sending message [SuiteMessage ==> suite:Suite, starting, methodCount:0]
[BaseMessageSender] Received ACK:>ACK
[BaseMessageSender] Received ACK:>ACK
Please choose Environment mode(1 for QA, 2 for Staging or 3 for PROD):1
Testing against QA Environment
Do you want to use Applitools eye?(1 for Yes, or continue for No):2
Testing without Applitools visual testing
[Appium] Welcome to Appium v1.6.5
[Appium] Appium REST http interface listener started on 0.0.0.0:4723
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.6.5”,“revision”:null}}
[HTTP] <-- GET /wd/hub/status 200 18 ms - 83
[HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:"/Users/menypeled/Documents/workspace/Droid_Appium/APK/SkyGiraffe__Beta_5_11_5.apk",“newCommandTimeout”:1200,“automationName”:“uiautomator2”,“browserName”:“android”,“platformName”:“Android”,“version”:"",“deviceName”:“Nexus 5X”,“platform”:“ANDROID”}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:"/Users/menypeled/Documents/workspace/Droid_Appium/APK/SkyGiraffe__Beta_5_11_5.apk",“newCommandTimeout”:1200,“automationName”:“uiautomator2”,“browserName”:“android”,“platformName”:“Android”,“version”:"",“deviceName”:“Nexus 5X”,“platform”:“ANDROID”},null,null]
[debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1504081646424 (11:27:26 GMT+0300 (IDT))
[Appium] Creating new AndroidUiautomator2Driver (v0.3.3) session
[Appium] Capabilities:
[Appium] app: ‘/Users/menypeled/Documents/workspace/Droid_Appium/APK/SkyGiraffe__Beta_5_11_5.apk’
[Appium] newCommandTimeout: 1200
[Appium] automationName: ‘uiautomator2’
[Appium] browserName: ‘android’
[Appium] platformName: ‘Android’
[Appium] version: ‘’
[Appium] deviceName: ‘Nexus 5X’
[Appium] platform: ‘ANDROID’
[BaseDriver] The following capabilities were provided, but are not recognized by appium: version, platform.
[BaseDriver] Session created with session id: f4da3a9f-4fec-488c-86de-79fb68f9d970
[BaseDriver] Using local app ‘/Users/menypeled/Documents/workspace/Droid_Appium/APK/SkyGiraffe__Beta_5_11_5.apk’
[debug] [UiAutomator2] Checking whether app is actually present
[UiAutomator2] UIAutomator2 Driver version:0.3.3
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_111
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/menypeled/Library/Android/sdk/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: 00cfa6ed1739c2e7
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/menypeled/Library/Android/sdk/platform-tools/adb
[debug] [ADB] Setting device id to 00cfa6ed1739c2e7
[debug] [AndroidDriver] Parsing package and activity from app manifest
[ADB] Checking whether aapt is present
[ADB] Using aapt from /Users/menypeled/Library/Android/sdk/build-tools/25.0.2/aapt
[ADB] Extracting package and launch activity from manifest
[debug] [ADB] badging package: com.skygiraffe.operationaldata
[debug] [ADB] badging act: com.skygiraffe.operationaldata.LoginScreenActivity
[debug] [AndroidDriver] Parsed package and activity are: com.skygiraffe.operationaldata/com.skygiraffe.operationaldata.LoginScreenActivity
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“getprop”,“ro.build.version.release”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“wm”,“size”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“getprop”,“ro.product.model”]
[debug] [ADB] Current device property ‘ro.product.model’: Nexus 5X
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“getprop”,“ro.product.manufacturer”]
[debug] [ADB] Current device property ‘ro.product.manufacturer’: LGE
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“am”,“force-stop”,“io.appium.uiautomator2.server”]
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“wait-for-device”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“echo”,“ping”]
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing settings apk to device…
[debug] [ADB] Getting install status for io.appium.settings
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“pm”,“list”,“packages”,“io.appium.settings”]
[debug] [ADB] App is installed
[debug] [ADB] Getting package info for io.appium.settings
[debug] [ADB] Getting connected devices…
[ADB] Checking whether aapt is present
[ADB] Using aapt from /Users/menypeled/Library/Android/sdk/build-tools/25.0.2/aapt
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“dumpsys”,“package”,“io.appium.settings”]
[ADB] Cannot read version codes of /usr/local/lib/node_modules/appium/node_modules/io.appium.settings/app/build/outputs/apk/settings_apk-debug.apk and/or io.appium.settings. Assuming correct app version is already installed
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“getprop”,“ro.build.version.sdk”]
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“dumpsys”,“package”,“io.appium.settings”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“pm”,“dump”,“io.appium.settings”]
[debug] [ADB] Got the following command chunks to execute: pm,grant,io.appium.settings,android.permission.WRITE_SETTINGS,;,pm,grant,io.appium.settings,android.permission.ACCESS_MOCK_LOCATION,;
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“pm”,“grant”,“io.appium.settings”,“android.permission.WRITE_SETTINGS”,";",“pm”,“grant”,“io.appium.settings”,“android.permission.ACCESS_MOCK_LOCATION”,";"]
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“pm”,“grant”,“io.appium.settings”,“android.permission.WRITE_SETTINGS”,";",“pm”,“grant”,“io.appium.settings”,“android.permission.ACCESS_MOCK_LOCATION”,";"]
[debug] [AndroidDriver] Pushing unlock helper app to device…
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“install”,"/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“install”,"/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[debug] [ADB] Application ‘/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk’ already installed. Continuing.
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“appops”,“set”,“io.appium.settings”,“android:mock_location”,“allow”]
[debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200
[debug] [ADB] Forwarding system: 8200 to device: 6790
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“forward”,“tcp:8200”,“tcp:6790”]
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“dumpsys”,“window”]
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [AndroidDriver] Extracting strings from apk /Users/menypeled/Documents/workspace/Droid_Appium/APK/SkyGiraffe__Beta_5_11_5.apk null /var/folders/mr/lbh2rfw568g5v74x7g7vgx440000gn/T/com.skygiraffe.operationaldata
[debug] [ADB] Extracting strings for language: default
[debug] [ADB] Device API level: 25
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“getprop”,“persist.sys.locale”]
[debug] [ADB] Current device property ‘persist.sys.locale’: en-US
[debug] [ADB] No strings.xml for language ‘en’, getting default strings.xml
[debug] [ADB] Reading strings from converted strings.json
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“push”,"/var/folders/mr/lbh2rfw568g5v74x7g7vgx440000gn/T/com.skygiraffe.operationaldata/strings.json","/data/local/tmp"]
[debug] [UiAutomator2] Deleting UiAutomator2 session
[debug] [UiAutomator2] Deleting UiAutomator2 server session
[UiAutomator2] Did not get confirmation UiAutomator2 deleteSession worked; Error was: Error: Trying to proxy a session command without session id
[debug] [ADB] Getting connected devices…
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“shell”,“am”,“force-stop”,“com.skygiraffe.operationaldata”]
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Removing forwarded port socket connection: 8200
[debug] [ADB] Running ‘/Users/menypeled/Library/Android/sdk/platform-tools/adb’ with args: ["-P",5037,"-s",“00cfa6ed1739c2e7”,“forward”,"–remove",“tcp:8200”]
[MJSONWP] Encountered internal error running command: Error: JAVA_HOME is not set currently. Please set JAVA_HOME.
at getJavaHome (../../lib/helpers.js:104:9)
at getJavaForOs (../../lib/helpers.js:93:17)
at ADB.callee$0$0$ (../../../lib/tools/apk-signing.js:75:16)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at enqueueResult (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:185:17)
at F (/usr/local/lib/node_modules/appium/node_modules/core-js/library/modules/$.export.js:30:36)
at AsyncIterator.enqueue (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:184:12)
at AsyncIterator.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at Object.runtime.async (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:209:12)
at ADB.callee$0$0 [as checkApkCert] (../../../lib/tools/apk-signing.js:75:13)
at AndroidUiautomator2Driver.initAUT$ (../../lib/driver.js:318:35)
at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[HTTP] <-- POST /wd/hub/session 500 9328 ms - 190