2gis / Winium.Mobile

Winium.Mobile is Selenium Remote WebDriver implementation for automated testing of Windows StoreApps and Silverlight apps, tested on emulators (currently only Windows Phone/Mobile apps are supported).
Mozilla Public License 2.0
51 stars 29 forks source link

A packaging error thrown when deploying universal windows application #116

Open dnovikau opened 8 years ago

dnovikau commented 8 years ago

Steps to reproduce:

  1. Download latest version of 'Winium.StoreApps' from https://github.com/2gis/Winium.StoreApps image
  2. Bulid the solution and start StoreApp.Driver from '\Winium.StoreApps.Driver\bin\x86\Debug' folder
  3. Create new Blank app (Universal Windows) project image
  4. Added Reference to 'InnerServer' project image
  5. Try to deploy UWP app with the following capabilities image

Expected behavior: Emulator is started and app is deployed successfully Actual behavior: emulator(Mobile Emulator 10.0.10240.0 WVGA 4 inch 512MB) is started but app is not deployed due to exceptio - 'A packaging error prevented this application from installing. (33)'

Console output for StoreApps.Driver is following: image

note: additional logging output was added to the place where exception is thrown

dnovikau commented 8 years ago

Described error happened due to the framework was trying to deploy dependencies build for not suitable architecture (ARM, x64) when application is build for x86. Work around is to remove specified folders from 'Dependencies' directory.

NickAb commented 8 years ago

Thanks for additional information.

Turns out I was testing it on package that contains build for x86 only. I will look if it could be fixed on our side, or if it is on MS libraries side. Until then creating store package with x86 only should work.

I think we should try to pick correct dependencies automatically, so I have reopened your issue.

dnovikau commented 8 years ago

One more update to current issue:

  1. First time exception is been thrown because of discrepancy between expected and actual package types (in my case 'manifestInfo.PackageType' = 'XAP, Main') in the following place: image

in order to let the code go forward and enforce trying to deploy UWP app I had to comment this verification -> then i found that deployment will fail on installing dependencies

sargissargsyan commented 7 years ago

I have the same issue. It creates x64 and ARM even if the options are unchecked in Create app packages. After removing x64 and ARM from discrepancies folder it still trows expatiation:

{
  "sessionId": "40cc8c95-ff49-4573-9b46-4d00198a8c04",
  "status": 33,
  "value": {
    "error": "session not created",
    "stacktrace": "   at Winium.Mobile.Driver.CommandExecutors.NewSessionExecutor.DoImpl() in c:\\Dev\\Winium.StoreApps\\Winium\\Winium.Mobile.Driver\\CommandExecutors\\NewSessionExecutor.cs:line 38\r\n   at Winium.Mobile.Driver.CommandExecutors.CommandExecutorBase.Do() in c:\\Dev\\Winium.StoreApps\\Winium\\Winium.Mobile.Driver\\CommandExecutors\\CommandExecutorBase.cs:line 42",
    "message": "A packaging error prevented this application from installing."
  }
}
NickAb commented 7 years ago

One workaround I was able to find was to deploy .appx using Visual Studio to the emulator you want to test on. This will make sure that all dependencies, including framework are satisfied. Then you should make a snapshot of the emulator using XDE tools window and set this snapshot as default boot state for the emulator. After completing these steps driver should be able to deploy .appx without errors, if the problem was in dependencies.

Internally we use same libraries which are used by AppDeploy tool form Microsoft which itself did not support new UWP packages, so we patched it to make it work with basic packages. If someone have a time to research how Visual Studio does deployment or how it is done using new tools from Windows 10 SDK, we would really appreciate any help. But new tools from Windows 10 Mobile SDK requires pairing of devices and host system to be able to deploy, these includes manual entry of PIN code, which might make environment setup for test runs on emulators very laborious and fragile.

Unfortunately we do not have complex UWP app for Windows 10 to test this and we stopped our mobile app development at Store Apps for Windows 8.1, which seems to deploy both to Windows Phone 8.1 and Windows 10 Mobile without any problem.