Undebuggable crash launching from Cortana (or - how can I attach the debugger to my about-to-crash phone app?)
Hello,
I integrated voice activation for my WP8.1 universal app, however it doesn't appear to be possible to debug the case when starting the app afresh via Cortana with speech terms.
There are three main speech startup cases I've played with:
1) App is suspended - can be seen in multitasking list by holding down back button, go to Cortana "myapp do something" - reactivates the app, calls App.OnActivated. Works fine.
2) App has been terminated - not in the multitasking list. Go to Cortana "start myapp" - starts the app like it was launched from the app list, calls App.OnLaunched but not
OnActivated. Works fine.
3) App has been terminated - not in the multitasking list. Go to Cortana "myapp do something" - starts the app, comes through to App.OnActivate but the app hangs for a few seconds on
the splash screen and crashes (device and emulator).
I want to catch the 3) case in the debugger, but cannot find a way to attach the debugger to my running package in the time window between activation and crashing. I think something is happening
deep in xaml land, but it's become impossible to instrument. I'm actually at the point now where it doesn't do anything in the OnActivate handler at all... no page navigation happens in the app but it still crashes.
I have a debug dump showing what appears to be a divide-by-zero exception but I can't seem to debug it in VS2013 as it complains about skipping loading symbols for NGen'd exe and "The exception
thread has exited or the dump contains invalid thread information".
I cannot seem to find any information on how to effectively debug this scenario - it seems an important one for Cortana integration.
Basic repro:
In VS2013, create a new universal Hub app and editing the Windows Phone project:
Add Microphone capability in app manifest
Change the Display Name in the app manifest to something sayable.
Add in the most trivial speech activation capability using the VoiceCommandManager in App.OnLaunched with a very basic speech file.
Run once from the debugger to ensure everything is set up ok and voice command file is installed.
Kill from the debugger to make sure the app is terminated.
Hold down phone/emulator search button.
Say the phrase to start your app (in my case "CortanaCrashTest test something").
Cortana recognises the phrase and says it's going to start your app... app starts...
Sits on app splash screen, hang and crash.
Here are my code modifications:
Right at the top of App.OnLaunched:
#if WINDOWS_PHONE_APP
var storageFile = await Windows.Storage.StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Speech.xml"));
await Windows.Media.SpeechRecognition.VoiceCommandManager.InstallCommandSetsFromStorageFileAsync(storageFile);
#endif
Speech.xml (added to project as content):
<?xml version="1.0" encoding="utf-8" ?>
<VoiceCommands xmlns="http://schemas.microsoft.com/voicecommands/1.1">
<CommandSet xml:lang="en-us" Name="test">
<Example>test stuff</Example>
<Command Name="test">
<Example>test stuff</Example>
<ListenFor>test {*}</ListenFor>
<Feedback>test...</Feedback>
<Navigate/>
</Command>
</CommandSet>
</VoiceCommands>
Thanks,
Will.
Hello,
I had the same problem and solved it.
This issue occurred because OnLaunched method is not called when the App is activated.
You have to copy some code from OnLaunched method in order to correct your problem.
OnActivated method must start with this code to correct your issue :
protected override void OnActivated(IActivatedEventArgs args)
Frame rootFrame = Window.Current.Content as Frame;
if (rootFrame == null)
rootFrame = new Frame();
rootFrame.CacheSize = 1;
Window.Current.Content = rootFrame;
rootFrame.Navigate(typeof(YourMainPage));
Window.Current.Activate();
// Your code here
Regards
Similar Messages
-
After upgrading to Windows, in my Outlook 2007 Contacts I now have "Contacts in iCloud" plus "Contacts from iCloud". How can I merge the two to avoid duplication.
Hi Ingo 2711,
Thank you for your suggestion. I backup on itunes. I went to itunes, deleted syncing my contacts, then re-synced them. But the Facetime capability option continues to be there on most (not all, for some curious reason) of my contacts. I am not sure I posed my question correctly. I want to be able to FT with my family, so don't want to delete the FT capability totally from my iphone and ipad. But I don't want all these other iphone calls from various contacts to ring on my ipad as FT calls. I want a way to select with whom I have FT capabilities. Any further suggestions? Thanks much, trekpal -
After downloading a pdf from a website, how can I view the file in Safari 6.0.4 (just as I can in Safari 5.0.6)? I bet that it's simple, but I've missed something, somewhere, and a solution will be greatly appreciated.
Hello Kirk,
Thank's for your efforts, and I just wish that this was the solution. Unfortunately, it isn't because, after double-clicking on the pdf in the website, it simply "opens" in another Safari window as a black screen - the pdf is there, somewhere, but not visible (either as an icon, or as a document).
When I right-click in the black Safari window, where the file is supposed to be, the only option available to display the file is to "Open file in Internet Explorer" (which is not what I want to do). Other options include saving or printing the pdf, which I don't want until I've confirmed that it's the form that I want. The same options are offered if I right-click on the file icon in the website.
Any other suggestions, please? -
it says that i have to pay again to download it from itunes.. how can i get the game in my itunes and phone? do I accept the charges and it will be re-embersed? what should I do? I have the order confirmation number etc.
Contact iTunes Customer Service and request assistance
Use this Link > Apple Support iTunes Store Contact -
My iPhone is from Japan and I want to activate it here in the Philippines because I'm living here. I have lost the original SIM from Softbank and replaced it with a new SIM card from Globe. How can I use the SIM card from Globe?
You cannot. The iPhone is locked to Softbank, and only they can unlock it. Problem is that Softbank will NOT unlock the phone, as they do not offer iPhone unlocking.
Buy an iPhone in the Phillipines.
PS Before you go on a rant at Apple, be aware that Apple does NOT unlock phones and they do not set unlocking policies. The carriers (Softbank in this case) set the unlocking policy. -
I have iPhone 4, it was working just fine..no I have a problem: it keeps searching for the network and then says no network..it was open to clean from inside..how can I fix the problem
Tap Settings > General > Reset > Reset Network Settings
If that doesn't help, try here > iOS: Troubleshooting Wi-Fi networks and connections -
The e mail address which is in the setting of my I tune store does not show up when I install apps or update them it shows a different email address how can I delete the e mail which shows up while updating apps & switch to the one already in my settings
All apps include DRM protection that is tied to the Apple ID that was used to download the apps.
This means the apps that need an update were downloaded with the Apple ID you are being prompted for. -
How can I get the same candy crush level on my phone and iPad?
How can I get the same candy crush level on my phone and iPad?
The only way to synchronize is connecting to FaceBook. I just set up my girl friend's iPhone to connect with FaceBook, which then updated the phone's level; then I downloaded the app (again) on her iPad and selected connect to Facebook. I'm not sure what the downfall of synchronizing through FaceBook is.... all I can tell you is it worked and now her iPad shows the same level as her iPhone. Good luck!
-
I can't remember my security questions. How can I find the answers in order to purchase my first app?
Go to: expresslane.apple.com
Under product categories choose iTunes
Then iTunes store
Then account management
Press continue.
Now choose iTunes store security and answer the bullet questions and click continue.
Sign in with your appleid and press continue
Under contact options fill out the information and advise iTunes that you would like your security/challenge questions reset. Click send.
iTunes will respond to you within 24 hours by email. -
HT201269 How can I disable the code when signing on to my phone?
How can I disable the code when signing on to my phone. This is very annoying.
Settings>General>Passcode Lock...enter your passcode, then: Turn Passcode Off.
-
I purchased an iPhone 3 and had taken some photos on it. I started having issues within 30 days and could replace it. So I created an iCloud account and saved those photos as a back up on iCloud. I did not restore my new phone from back up because I did not realize I needed to restore and not just activitate it. How can I save the new photos, apps, and other stuff but retrieve the old photos?
If all you want is your old photos, you could backup your new phone using iTunes, then restore it from your iCloud backup, import the old photos to your computer, then restore it from the backup your made in iTunes returning your newer data to your phone. If you want your old photos on your phone, sync them there from your computer using iTunes. The process would look like this:
Connect your phone to your computer, when it appears in iTunes on the left sidebar right-click on it and select Transfer Purchases; right-click again and select Backup.
Disconnect from your computer and go to Settings>General>Reset>Erase All Content and Settings to return it to new
Go through the activation setup, choosing to Restore from iCloud backup. Make sure your phone is plugged into a charger and has access to wi-fi as this can take hours to complete.
When complete, without connecting your phone to your computer, open iTunes and go to Preferences. On the Devices tab check "Prevent...from syncing automatically"
Now import the old photos to your computer (see http://support.apple.com/kb/HT4083)
When done, open iTunes, right-click on the name of your phone on the left sidebar and select Restore from Backup, choose the backup you made in step 1.
Go to the Photos tab and select the photos you want to sync to your phone and sync. -
How can I view the text messages sent and received on one of the other phones on my plan?
You would have to view them on the other phone.
-
how can i synchronise the ring tones I created on my iphone 4 (ios 5)? i tried to synchronise several times, but it doesn't work. everything ok, with the exception of the ringtones.
Tones is the new name for Ringtones. Enable from Edit > Preferences > General tab and sync to your iOS device from the Tones tab when the device is connected.
tt2 -
I have recently re-installed i-Work because I was getting a "pages cannot be opened because of a problem" response and I was unable to read any of my documents or open any attachments from my e-mails. After the install, 'pages' still will not open and gives the same response. How do I restore my 'pages' app?
I've never seen this error but I'd assume that it can be fixed the same way many Mac application errors are: open your Library folder and look inside the Preferences folder for the com.apple.iWork.Pages.plist file and throw it away.
-
Most of my music on my iPod was not from iTunes and I need to transfer it to my new MacBook Pro. Anyone know how, preferably without spending money?
http://lifehacker.com/5837978/how-can-i-transfer-music-from-my-ipod-or-iphone-to -my-computer
http://www.geek.com/articles/apple/how-to-transfer-music-from-an-ipod-to-the-com puter-2011081/
Maybe you are looking for
-
Creating a BP in CRM through LSMW using IDOC
I am trying to create a buss partner in crm through LSMW using IDOC: Message Type: CRMXIF_PARTNER_SAVE_M Basic Type: CRMXIF_PARTNER_SAVE_M02 I get an error: "No update is defined for BP role 000000". I am also filling IDENTIFICATIONCATEGORY: C
-
Sorting albums a-z, not by year..
no idea when this started to happen, can't have been long ago, but iTunes (7.5 (19)) is now organizing my library albums by their year, and I really don't want this!! I want to list my albums a-z! I can't find where I can switch this off. I ctrl-clic
-
32-bit ie9 opened on 64-bit system, as instructed...
have tried this download about 15 times. I get a screen showing the 4 dialog boxes I will likely encounter, and no instruction on how to proceed past that page. Download does not commence.
-
Please help me guys itll be a great help
-
Iphone could not be restored error 1669
Instead of my network provider, my iPhone displays 'Searching...'. I tried to reset through my iTunes and my phone but could not due to Find My iPhone, so I went onto Find My iPhone on my computer and erased my phone thinking it would be like a facto