joe
joe

Reputation: 15

Getting error while running android app through appium

I am getting the error while running the app through appium. When I run the appium doctor all the checks went successful. But get the error in appium. What I did is launched the app in appium. Then I ran the code from eclipse. And after I ran the code I got the error in the appium. Error is as follows:

Launching Appium with command: export ANDROID_HOME="(null)"; '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --address "127.0.0.1" --callback-address "127.0.0.1" --command-timeout "7200" --session-override --automation-name "Appium" --platform-name "Android" --platform-version "4.4" --app "/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk" --device-name "Nexus" --language "en"

info: Welcome to Appium v1.3.5 (REV a124a15677e26b33db16e81c4b3b34d9c6b8cac9)

info: Appium REST http interface listener started on 127.0.0.1:4723

info: [debug] Non-default server args: {"app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","address":"127.0.0.1","callbackAddress":"127.0.0.1","sessionOverride":true,"deviceName":"Nexus","platformName":"Android","platformVersion":"4.4","automationName":"Appium","language":"en","defaultCommandTimeout":7200}

info: Console LogLevel: debug

info: --> POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true,"rotatable":true,"takesScreenshot":true,"version":"4.4"}}

info: Client User-Agent string: undefined

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. : platform, browserConnectionEnabled, rotatable, takesScreenshot, version

info: [debug] No appActivity desired capability or server param. Parsing from apk.

info: [debug] No appPackage desired capability or server param. Parsing from apk.

info: [debug] Using local app from desired caps: /Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk

info: [debug] Creating new appium session 3e250c44-f7c1-4787-8551-7e9cf12edf4d

info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.7.0_71

info: [debug] Checking whether adb is present

error: Unhandled error: Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/(null)/build-tools'

    at Error (native)

    at Object.fs.readdirSync (fs.js:765:18)

    at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18)

    at ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:89:25)

    at ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:8)

    at androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1060:14)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:610:21

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:249:17

    at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:149:13)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:160:25 context: [POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true]

info: <-- POST /wd/hub/session - - ms - - 

info: --> POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true,"rotatable":true,"takesScreenshot":true,"version":"4.4"}}

info: Client User-Agent string: undefined

info: Found an existing session to clobber, shutting it down first...

info: Shutting down appium session

info: [debug] Pressing the HOME button

info: [debug] executing cmd: adb shell "input keyevent 3"

info: [debug] Cleaning up android objects

info: [debug] Cleaning up appium session

info: Old session shut down OK, proceeding to new session

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. : platform, browserConnectionEnabled, rotatable, takesScreenshot, version

info: [debug] No appActivity desired capability or server param. Parsing from apk.

info: [debug] No appPackage desired capability or server param. Parsing from apk.

info: [debug] Using local app from desired caps: /Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk

info: [debug] Creating new appium session 73f67505-4d83-4d3f-8bed-5d4b2b5a97ad

info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.7.0_71

info: [debug] Checking whether adb is present

error: Unhandled error: Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/(null)/build-tools'

    at Error (native)

    at Object.fs.readdirSync (fs.js:765:18)

    at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18)

    at ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:89:25)

    at ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:8)

    at androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1060:14)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:610:21

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:249:17

    at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:149:13)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:160:25 context: [POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true]

undefined

info: <-- POST /wd/hub/session - - ms - - 

info: --> POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true,"rotatable":true,"takesScreenshot":true,"version":"4.4"}}

info: Client User-Agent string: undefined

info: Found an existing session to clobber, shutting it down first...

info: Shutting down appium session

info: [debug] Pressing the HOME button

info: [debug] executing cmd: adb shell "input keyevent 3"

info: [debug] Cleaning up android objects

info: [debug] Cleaning up appium session

info: Old session shut down OK, proceeding to new session

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. : platform, browserConnectionEnabled, rotatable, takesScreenshot, version

info: [debug] No appActivity desired capability or server param. Parsing from apk.

info: [debug] No appPackage desired capability or server param. Parsing from apk.

info: [debug] Using local app from desired caps: /Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk

info: [debug] Creating new appium session 56c5cb37-9da8-46cd-a6ea-c11254470b2c

info: Starting android appium

info: [debug] Getting Java version

info: Java version is: 1.7.0_71

info: [debug] Checking whether adb is present

error: Unhandled error: Error: ENOENT, no such file or directory '/Applications/Appium.app/Contents/Resources/node_modules/appium/(null)/build-tools'

    at Error (native)

    at Object.fs.readdirSync (fs.js:765:18)

    at exports.getDirectories (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/helpers.js:100:18)

    at ADB.checkSdkBinaryPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:89:25)

    at ADB.checkAdbPresent (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/lib/adb.js:126:8)

    at androidCommon.initAdb (/Applications/Appium.app/Contents/Resources/node_modules/appium/lib/devices/android/android-common.js:1060:14)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:610:21

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:249:17

    at iterate (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:149:13)

    at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/async/lib/async.js:160:25 context: [POST /wd/hub/session {"desiredCapabilities":{"platform":"ANDROID","app":"/Users/vikas/Downloads/BNGA_BOS_7.0_1012_183_T.apk","platformName":"Android","deviceName":"Android","browserName":"","browserConnectionEnabled":true]

Please help me to solve the problem. I am new to appium

Upvotes: 1

Views: 797

Answers (3)

Shivam Gupta
Shivam Gupta

Reputation: 1

After read the logs I think you are not passing correct app activity and app package name. Please try to pass correct details it will work.

Upvotes: 0

Gobeaner
Gobeaner

Reputation: 378

How you are executing your code, can you post your code. Initial impression of your issue is that you need to set ANDROID_HOME. You can see link.

Upvotes: 0

Gaurav
Gaurav

Reputation: 1370

I think you need to install the node again. Follow here

Upvotes: 1

Related Questions