SessionNotCreatedException: A new session could not be created.INSTALL_FAILED_ALREADY_EXISTS: - automation

info: [debug] Setting device id to ZY223DDMM8
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 wait-for-device
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\Windows\system32\cmd.exe /s /c "E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c "E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n)","killed":false,"code":1,"signal":null,"cmd":"C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"","origValue":"Command failed: C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 3251.479 ms - 1342

add --no-reset flag so that appium doesnt try to install the apk again or uninstall the apk before you run the test scripts

Related

Bazel can't find g++ despite both MSYS2 and native shell supporting it

I have installed Bazel through Chocolatey on Windows and MSYS2 to have access to bash.exe.
A script I am trying to build uses g++ which I installed through pacman in MSYS2 and also added to PATH. I am able to run g++ --version in both the MSYS2 shell and my native Powershell.
But somehow it seems as if MSYS2 can't run g++ when I am running it through Bazel.
C:/<censored>> bazel build //kernels:rasterize_triangles_kernel
INFO: Analyzed target //kernels:rasterize_triangles_kernel (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/<censored>/kernels/BUILD:20:8: Executing genrule //kernels:rasterize_triangles_kernel failed: (Exit 127): bash.exe failed: error executing command (from target //kernels:rasterize_triangles_kernel) C:\msys64\usr\bin\bash.exe -c ... (remaining 1 argument skipped)
/usr/bin/bash: line 1: g++: command not found
Target //kernels:rasterize_triangles_kernel failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 4.883s, Critical Path: 4.80s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully

reavt native event.js 167 error //unknown error

BUILD SUCCESSFUL in 14s
28 actionable tasks: 1 executed, 27 up-to-date
Running adb -s 988ad833354d59594330 reverse tcp:8081 tcp:8081
Starting the app on 988ad833354d59594330 (adb -s 988ad833354d59594330 shell am start -n com.celebrations/com.celebrations.MainActivity)...
Starting: Intent { cmp=com.celebrations/.MainActivity }
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
i was building the code for the first time and getting this error while compiling.
any solutions for this error??
It means you already use port 8081, but you can run these commands:
sudo lsof -i :8081
kill -9 < PID >

proto_text/gen_proto_text_functions.runfiles [for host] failed

command:
bazel build --config=opt --config=cuda //tensorflow/tools/pip_package:build_pip_package --verbose_failures
Error:
tensorflow/tensorflow/tools/proto_text/BUILD:33:1: Creating runfiles tree bazel-out/host/bin/tensorflow/tools/**proto_text/gen_proto_text_functions.runfiles** [for host] failed (Exit 1): build-runfiles failed: error executing command
(cd /mnt/lustre/sjtu/users/mkh96/.cache/bazel/_bazel_mkh96/44343823a879bff37be22e42f904ace4/execroot/org_tensorflow && \
exec env - \
_bin/build-runfiles bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions.runfiles_manifest bazel-out/host/bin/tensorflow/tools/proto_text/gen_proto_text_functions.runfiles)
Target //tensorflow/tools/pip_package:build_pip_package failed to build
INFO: Elapsed time: 337.846s, Critical Path: 0.12s
INFO: 1 process, local.
FAILED: Build did NOT complete successfully
srun: error: lianyungang: task 0: Exited with exit code 1
Here is the more evident compiling instructions
And if you want to install tf bindings, please refer to this guide.

xcodebuild failed with code 65

When i try to launch App with Appium getting below error
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"xcodebuild\"|grep -i \"faea4372d3a65bdb23969752f0d5902ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
I've tried by adding Code_signing and team id with xcodeconfig capability but it is not working, could you please help me on this
Below are the capabilities set to
app: '/Users/arun/Documents/App/iOSAutomationTests/src/main/resources/test.ipa'
rotatable: true
newCommandTimeout: 120
realDeviceLogger: '/usr/local/lib/node_modules/deviceconsole'
platformVersion: '10.1.1'
automationName: 'XCUITest'
xcodeConfigFile: '/src/main/resources/myconfig.xcconfig'
platformName: 'iOS'
udid: 'faea4372d3a65bdb23969752f0d5902ca21c5571'
deviceName: 'faea4372d3a65bdb23969752f0d5902ca21c5571'
autoAcceptAlerts: true
Below is the log
XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"xcodebuild\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"/usr/local/lib/node_modules/deviceconsole\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"iproxy\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[XCUITest] Real device logger '/usr/local/lib/node_modules/deviceconsole' is a directory. Appending 'deviceconsole' executable
[debug] [XCUITest] Using real device logger '/usr/local/lib/node_modules/deviceconsole/deviceconsole'
[debug] [XCUITest] Using Xcode configuration file: '/src/main/resources/myconfig.xcconfig'
[debug] [XCUITest] Beginning test with command 'xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=faea4372d3a65bdbd7969752f0d5948ca21c5571 -configuration Debug -xcconfig /src/main/resources/myconfig.xcconfig' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log
[Xcode] 2017-02-03 14:27:41.093 xcodebuild[4292:81409] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log}
[Xcode]
Testing failed:
./Scripts/generate_modules.sh: line 15: Modules/module.modulemap: No such file or directory
** TEST FAILED **
The following build commands failed:
PhaseScriptExecution Generate\ modules /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Intermediates/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentLib.build/Script-AD35D0281CF1B37A00870A75.sh
[Xcode] (1 failure)
Make sure your current user has write permissions to the folder where Appium is currently installed.
You can find some help here to change permission: https://apple.stackexchange.com/questions/16180/xcode-problem-with-directory-permissions
This issue is solved with Appium 1.6.3.
if you still face any issues, you can find the solution here:
https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md
Code 65 is the issue with code_signing,
If xcode config is not working for you, try manually signing WebDriverAgent in Xcode, that should do the trick, however I would suggest upgrading to 1.6.4, in which this issue has been resolved:
Allow for the auto-generation of the Xcode config file used to configurable
WDA before launch. This includes two new desired capabilities
xcodeOrgId - the Apple developer team identifier string
xcodeSigningId - a string representing a signing certificate, defaulting to
"iPhone Developer"
Below is the link:
https://github.com/appium/appium/releases

bower says "invalid tar file", but it's actually a valid tar file

I uploaded a bower component as a tar file, and even though I know it's a valid tar file, when running bower install, I get the following error:
bower my-component#* error invalid tar file
Stack trace: Error: invalid tar file
at Extract.Parse._startEntry (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:144:13)
at Extract.Parse._process (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:125:12)
at BlockStream.<anonymous> (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:46:8)
at BlockStream.EventEmitter.emit (events.js:95:17)
at BlockStream._emitChunk (/usr/local/lib/node_modules/bower/node_modules/tar/node_modules/block-stream/block-stream.js:145:10)
at BlockStream.resume (/usr/local/lib/node_modules/bower/node_modules/tar/node_modules/block-stream/block-stream.js:58:15)
at Extract.Reader.resume (/usr/local/lib/node_modules/bower/node_modules/fstream/lib/reader.js:253:34)
at Entry.<anonymous> (/usr/local/lib/node_modules/bower/node_modules/tar/lib/parse.js:256:8)
at Entry.EventEmitter.emit (events.js:92:17)
at Entry.resume (/usr/local/lib/node_modules/bower/node_modules/tar/lib/entry.js:92:8)
Console trace: Trace
at StandardRenderer.error (/usr/local/lib/node_modules/bower/lib/renderers/StandardRenderer.js:74:17)
at Logger.<anonymous> (/usr/local/lib/node_modules/bower/bin/bower:114:22)
at Logger.EventEmitter.emit (events.js:95:17)
at Logger.emit (/usr/local/lib/node_modules/bower/node_modules/bower-logger/lib/Logger.js:29:39)
at /usr/local/lib/node_modules/bower/lib/commands/install.js:35:16
at _rejected (/usr/local/lib/node_modules/bower/node_modules/q/q.js:807:24)
at /usr/local/lib/node_modules/bower/node_modules/q/q.js:833:30
at Promise.when (/usr/local/lib/node_modules/bower/node_modules/q/q.js:1077:31)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/bower/node_modules/q/q.js:751:41)
at /usr/local/lib/node_modules/bower/node_modules/q/q.js:573:44
System info: Bower version:
1.3.0 Node version: 0.10.26
OS: Linux 2.6.32-5-amd64 x64
I have checked other tar files that have been uploaded the same way, and they look pretty much the same as mine.
Ideas?
The issue was the version of the tar file. I created the tar file using a Maven plugin: maven-assembly-plugin, but didn't specify the version. However it worked after setting the version to 2.4.