Error ActivateApplication in my Windows Cordova ap

2019-05-24 00:52发布

I want to get the blank app working on the windows platform. I did the following:

ionic start myApp blank
cd .\myApp\
ionic platform add windows
ionic emulate windows

them I'm getting the following exception:

Starting application...
ActivateApplication:  com.ionicframework.myappmework.myapp781
Ausnahme beim Aufrufen von "ActivateApplication" mit 4 Argument(en):  "Der Remoteprozeduraufruf ist fehlgeschlagen.
(Ausnahme von HRESULT: 0x800706BE)"
In C:\...\myApp\platforms\windows\cordova\lib\WindowsStoreAppUtils.ps1:164 Zeichen:5
+     $appActivator.ActivateApplication($applicationUserModelId,$null,[ ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : COMException

What I need to fix?

3条回答
小情绪 Triste *
2楼-- · 2019-05-24 01:31

Run ionic run windows -- --win to deploy to windows. ionic run windows -- --phone to launch application on emulator. And ionic run windows --device -- --phone to launch on real device. Plus if you still get failed then run ionic run windows --list to see if there is any target(emulator or device) available or not.

查看更多
一纸荒年 Trace。
3楼-- · 2019-05-24 01:44

I ran into the same issue with an app and it could not be related to my cordova or SDK installation, as another app worked perfectly fine.

In my case, it was related to JavaScript errors. First, I updated jQuery to the latest version, which made the error message vanish. However, the app would still crash directly after starting it up, which was related to another JS-error (as seen in the JS console when running it in a browser). Fixing this made it finally work as expected.

查看更多
神经病院院长
4楼-- · 2019-05-24 01:47

Be sure the Windows 10 SDK is installed. In your config.xml add the following entry:

<preference name="windows-target-version" value="10.0" />

That should fix it.

查看更多
登录 后发表回答