Error -1073740940 when running UITest on device or emulator - android

When running a Xamarin Android UITest either in the device or in the emulator I'm getting the return code -1073740940 on ADB.exe.
Test Name: AppLaunches
Test FullName: UITest1.Tests.AppLaunches
Test Source: d:\documents\visual studio 2015\Projects\UITest1\UITest1\Tests.cs : line 34
Test Outcome: Failed
Test Duration: 0:00:18,392
Result StackTrace:
at Xamarin.UITest.Shared.Processes.ProcessRunner.Run(String path, String arguments)
at Xamarin.UITest.Shared.Android.Commands.CommandAdbInstallPackage.Execute(IProcessRunner processRunner, IAndroidSdkTools androidSdkTools)
at Xamarin.UITest.Shared.Execution.Executor.Execute[TDep1,TDep2](ICommand`2 command)
at Xamarin.UITest.Shared.Android.LocalAndroidAppLifeCycle.InstallApps(ApkFile[] apkFiles)
at Xamarin.UITest.Shared.Android.LocalAndroidAppLifeCycle.EnsureInstalled(ApkFile appApkFile, ApkFile testServerApkFile)
at Xamarin.UITest.Android.AndroidApp..ctor(IAndroidAppConfiguration appConfiguration)
at Xamarin.UITest.Configuration.AndroidAppConfigurator.StartApp(AppDataMode appDataMode)
at UITest1.Tests.BeforeEachTest() in d:\documents\visual studio 2015\Projects\UITest1\UITest1\Tests.cs:line 22
Result Message:
SetUp : System.Exception : Failed to execute: D:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -s 022AQQ7N45014727 install "C:\Users\NB15664\AppData\Local\Temp\uitest\a-2B6E82A0AC77924F988970B83F62C1E372AA00FF\final-02F6B92052E860F661D6071DDD9EC4F95C4ED181.apk" - exit code: -1073740940
pkg: /data/local/tmp/final-02F6B92052E860F661D6071DDD9EC4F95C4ED181.apk
Success
The output windows gives me this:
Test Name: AppLaunches
Test Outcome: Failed
Result Message:
SetUp : System.Exception : Failed to execute: D:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -s 022AQQ7N45014727 install "C:\Users\NB15664\AppData\Local\Temp\uitest\a-2B6E82A0AC77924F988970B83F62C1E372AA00FF\final-02F6B92052E860F661D6071DDD9EC4F95C4ED181.apk" - exit code: -1073740940
pkg: /data/local/tmp/final-02F6B92052E860F661D6071DDD9EC4F95C4ED181.apk
Success
Result StandardOutput: Full log file: C:\Users\AppData\Local\Temp\uitest\log-2016-04-20_16-43-10-687.txt
Skipping IDE integration as important properties are configured. To force IDE integration, add .PreferIdeSettings() to ConfigureApp.
Android test running Xamarin.UITest version: 1.0.0
Running in unactivated mode. Test run will be restricted to simulators for a maximum duration of 15 minutes. The full version is available for Xamarin Test Cloud customers, for more information contact sales#xamarin.com.
Initializing Android app on device 022AQQ7N45014727 with apk: d:\documents\visual studio 2015\Projects\UITest1\app-debug.apk
Signing apk with Xamarin keystore.
If I send the APK for remote test execution it works and passes.
What can possibly be the issue?

Replacing my adb.exe from 20/04/2016 17:13 to one from 20/08/2015 13:21 solved the issue.
Thanks.

Related

Original error: Failure [INSTALL_FAILED_OLDER_SDK]

When I run karate testing with appium it gives this error
I installed :
Android-studio
appium
node
npm
Original error: pkg: /data/local/tmp/appium_cache/31bc49edb643a4a324f739a34babfd1e6d522a16.apk\r\nFailure [INSTALL_FAILED_OLDER_SDK]"},
Full error msg:
ExamplesTest driver config / start failed: webdriver session
create status 500, {"status":13,"value":{"message":"An
unknown server-side error occurred while processing the
command. Original error: pkg:
/data/local/tmp/
appium_cache/31bc49edb643a4a324f739a34babfd1e6d522a16
.apk\r\nFailure
[INSTALL_FAILED_OLDER_SDK]"},"sessionId":null}, options:
{type=android, webDriverPath=/wd/hub, start=true,
httpConfig={readTimeout=120000}, target=null,
webDriverSession={desiredCapabilities=
{app=/home/yabesh/Downloads/UiDemo.apk,
newCommandTimeout=300, platformVersion=5.1,
platformName=Android, connectHardwareKeyboard=true,
deviceName=emulator-554, avd=Nexus_4_API_22,
automationName=UiAutomator2}}}
classpath:test/test_features/android/android.feature:28
how to resolve that.please help me.
Issue Sorted Out:
I found and sort out this issue. The problem is with the Android emulator configurations currently running. After reconfiguring the emulator the error disappeared and ran without any problem.

java.lang.IllegalArgumentException: Error: Failed to parse APK file:

I have search stockoverflow and google with no luck. I recently migrated my app to androidx, after a lot of effort I was able to fix all the build fails. but now I am getting the following error when the app is installing on the emulator or the device. any help will be highly appreciated.
I have tried the following:
invalidate caches/restart
clean build and rebuild project
uninstalled app from the device
restarted my pc
Exception occurred while executing:
java.lang.IllegalArgumentException: Error: Failed to parse APK file: /data/local/tmp/...
at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:338)
at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:906)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21328)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2821)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3856)
at android.os.Binder.execTransact(Binder.java:731)
Caused by: android.content.pm.PackageParser$PackageParserException: Failed to parse /data/local/tmp/...
at android.content.pm.PackageParser.parseApkLiteInner(PackageParser.java:1590)
at android.content.pm.PackageParser.parseApkLite(PackageParser.java:1575)
at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:331)
... 9 more
$ adb shell pm uninstall ...
Unknown failure (at android.os.Binder.execTransact(Binder.java:731))
Error while Installing APK
Delete the previous app-release.apk file from the android folder:
\app\build\outputs\apk\release
Then clear all data from the emulator. Finally, rebuild the application.
Clean -> Rebuild -> and try to check both v1 and v2 while generating apk file
You should drop the cache on your mobile.
for example:
1- open your windows terminal on your computer
2 - enter the command >adb shell
you should be insite on your mobile
3 - enter to the tmp/appium_cache/ folder with >cd data/local/tmp/appium_cache
4 - write the command >ls to see all the elements that there is insite of that folder
5 - drop all that elements with the command >rm filename
hope to help you
just delete build folder and run again
android/app/build

It is not possible to instrument the App in monkey talk pro

When I am trying to instrument the App in monkey talk it shows the following error in the console. anyone know how to solve it?
: ERROR: Process exited with an error: 1 (Exit value: 1)
instrumented APK file was not created at: /tmp/tmp_AndroidInstrumentor1398773468466_12/Caprabo_Modified/bin/Caprabo_Modified-debug.apk
Error instrumenting apk '/home/nandakishore/Desktop/Caprabo_Modified.apk': instrumented APK file was not created at: /tmp/tmp_AndroidInstrumentor1398773468466_12/Caprabo_Modified/bin/Caprabo_Modified-debug.apk
com.gorillalogic.monkeytalk.instrumentor.android.AndroidInstrumentor$InstrumentationException: instrumented APK file was not created at: /tmp/tmp_AndroidInstrumentor1398773468466_12/Caprabo_Modified/bin/Caprabo_Modified-debug.apk
at com.gorillalogic.monkeytalk.instrumentor.android.AndroidInstrumentor.copyInstrumentedApk(AndroidInstrumentor.java:235)
at com.gorillalogic.monkeytalk.instrumentor.android.AndroidInstrumentor.beginInstrumentation(AndroidInstrumentor.java:199)
at com.gorillalogic.monkeytalk.instrumentor.android.AndroidInstrumentor.instrumentApk(AndroidInstrumentor.java:130)
at com.gorillalogic.monkeytalk.ide.instrumentor.InstrumentApkAction$InstrumentApkJob.run(InstrumentApkAction.java:137)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)

Unable to ‎WebKit Layout Tests‎ on android

Compile the chromium for Android
Build every test:
$ ninja -C out/Release
Running the layout Tests
$ webkit/tools/layout_tests/run_webkit_tests.sh
I get following errors:
Using port 'chromium-linux-x86_64' Test configuration: Placing test results in
/host/chromium/src/webkit/Release/layout-test-results Baseline search
path: chromium-linux -> chromium-win -> generic Using Release build
Pixel tests enabled Regular timeout: 6000, slow test timeout: 30000
Command line:
/host/chromium/src/third_party/WebKit/out/Release/DumpRenderTree -
Found 29487 tests; running 28395, skipping 1092. Unable to find test
driver
at /host/chromium/src/third_party/WebKit/out/Release/DumpRenderTree
For complete Linux build requirements, please see:
http://code.google.com/p/chromium/wiki/LinuxBuildInstructions
Build check failed
Support for layout tests on Android is being worked on at the moment. See https://code.google.com/p/chromium/issues/detail?id=232044

Jenkins unable to locate files on my computer

when ever I try to build my android project on jenkins it fails by saying :
Started by user anonymous
Building in workspace /home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2
[mysteryshopper_version2] $ ant -Dlabel=trial1-9 clean debug
Buildfile: /home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2/build.xml
BUILD FAILED
/home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2/build.xml:90: Cannot find /home/tanzeelrana/android-sdk-linux/tools/ant/build.xml imported from /home/tanzeelrana/git/eventmatrix-cordova-app/mysteryshopper_version2/build.xml
Total time: 0 seconds
Build step 'Invoke Ant' marked build as failure
Finished: FAILURE
on line 90 in my build.xml file I have a tag with the following in it :
import file="/home/tanzeelrana/android-sdk-linux/tools/ant/build.xml"
does anyone know why it is unable to locate this file ? the file exist at the exact path ....
Jenkins usually runs with its own user (jenkins),
so it is probably an issue of permissions.
Try printing the current user from within your Jenkins job.
EDIT:
See here about running Jenkins as a daemon -
it also shows how to set it to run as a different user than 'jenkins':
Installing Jenkins as a Unix daemon

Categories

Resources