[TIMOB-18303] Windows: No emulators found when trying to build project
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-01-09T15:38:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Windows |
Labels | windows |
Reporter | Jamil Spain |
Assignee | Christopher Williams |
Created | 2015-01-05T17:24:44.000+0000 |
Updated | 2017-03-16T21:46:30.000+0000 |
Description
trying to build a project via the command line for windows. I just applied the Visual Studio Project update 4 to visual studio professional. I can successfully build a native project in Visual Studio 2013 with emulator 8-1-*.
Now when I try to build on command line using the command:
ti build -p windows -T wp-emulator -C 8-1-1 --wp-publisher-guid [GUID]
I get the error "no Windows Phone Emulators found"
no emulators are listed either when I run "ti info"
Please try the following:
Open Visual Studio
Create a new Windows Phone Project (not a Titanium one)
Try to run it on an emulator
Are there emulators listed there?Yes, emulators are listed and work fine
This is where i was as well, but using latest community edition and a ti info shows 2 emulators available. I'll go back to lurking as I don't have the time this week to get back into the windows stuff.
[~skypanther] is experiencing this issue as well, and I've spent a lot of time debugging it with him. So far it looks very much to me like a somewhat broken VS 2103 install. This is the only thing that appears to break and the underlying error stems from windowslib's wptool, which when trying to list the devices gives us:
I cannot for the life of me figure out why it won't work here, and the best indication I have is that the VS install has some old/bad DLL or something. One possible "fix" is not to rely on [~cb1kenobi]'s wptool to get the listing of devices, but instead defer to C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.1\Tools\AppDeploy\AppDeployCmd.exe for WP 8.1, and C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Tools\XAP Deployment\XapDeployCmd.exe for WP 8.0 to grab the listing of devices. We'd have to rely on basically using regex to parse out the output into structured data. I should note, however, that if wptool is busted for enumerating devices, it will be for connecting to devices as well, so we wouldn't be able to test if we can connect to a device which we use as a sanity check for deploying to device (and I think we use it for launching emulators without installing apps).
I don't understand why XapDeployCmd would work and wptool does not. It's making the same exact API calls as XapDeployCmd. The call in the stack to
Microsoft.VisualStudio.DeviceConnectivity.Interop.ConManClass.GetDatastore(UInt32 dwLocale)
is a native COM call. I have no clue what sort of file operations this function is doing. I Googled the error and found this: http://weblog.west-wind.com/posts/2005/Mar/12/And-the-Whidbey-SmartPhone-Saga-continues-with-the-February-CTP. The article is old, but explains that the user upgraded their VS and that's when things broke. So this may be the result of a corrupt VS install. I don't get why XapDeployCmd would work though. What is thisGetDatastore()
function doing? What file does not exist? A library? Maybe the file exists, but it's a file permissions thing?Chris, is this after installing the vs update 4 patch? Before the patch, I can confirm that the sdk saw devices, but could not start the app on the simulator, neither could vs professional 2013 start an 8.1 mobile native project.
It's possible that wptool was compiled with an older device connectivity assemblies, then after upgrading these files are no longer found. This is bad. That would explain the FileNotFoundException. Perhaps what we should do is after the "assembly" library finds the dependent assemblies, we copy them from the GAC to the windowslib directory, build wptool against them, and we're set. We can't distribute those assemblies, but we can copy them just in case the get blown away from the GAC. If [~skypanther] deletes the wptool.exe from the windowslib\bin folder, windowslib will recompile it. I wonder if this will fix his issue.
I tried deleting windowslib\wptool\bin\Release\wptool.exe as well as windowslib\bin\wptool.exe. Neither worked. I get the same error most of the time, though I also got:
(says the file was locked, though in fact it was deleted)
Just pulled a current CI Build 3.6.0v20150107091442 and the problem still persists for me.
[~cwilliams] windowslib should support launching an emulator without installing & launching an app. I'm pretty sure that you cannot launch the emulator, install the app, but not launch it.
[~cb1kenobi] I'm referring to launching an emulator without installing an app. We can use AppDeployCmd to simultaneously install an app and launch it, which launches an emulator as a byproduct - so replacing that functionality is easy (and actually that's what you already do, if I'm correct). But if we want to just launch the emulator without installing or launching a specific app, then it becomes a pain in the butt to do. I suppose I could cheat again there and ask the emulator to launch some pre-installed app using it's product id.
[~cwilliams] OK, so that's what wptool.connect() does. It will launch the emulator without installing an app.
[~cb1kenobi] Right, and if Tim/Jamil/whomever's wptool.exe is busted that won't work. So I need to come up with a fallback for launching an emulator without installing an app. I'm hoping I can just do AppDeployCmd /launch with a pre-installed app id, because if not the hack to launch an emulator from the command line sucks.
[~cwilliams] Make sense. So why is wptool not working for Tim and Jamil, yet AppDeployCmd works just fine? I know it's because of the exception, but is there something goofy with their setup? I wonder if my VM has the same issues?
[~cb1kenobi] That's the million $$$ question. I don't know. They both had a previous Windows Phone 8 setup they used for Win Hybrid, and then upgraded so that appears to be the common ground here. But I can't reproduce and I don't know how to debug further to determine why wptool is broken for them.
Ok, found it. The 8.0 tooling is broken for [~skypanther]. If he runs XapDeployCmd it fails with the same error. Because we fail immediately and don't try 8.1's tooling/devices, we get none.
Ha, well, there ya go. I'm cool with wptool going away. I never tried the bogus guid trick, but it works great! We just want to retain the logic that starts the emulator as soon as possible in the build, then call XapDeployCmd again to install the app.
https://github.com/appcelerator/windowslib/pull/10
By applying the windowslib PR#10 changes to my SDK I am able to build successfully for a Windows Phone 8.1 emulator. That PR has been merged.
https://github.com/appcelerator/titanium_mobile/pull/6550
reopening to assign sprint...
Closing ticket as the issue has been fixed.