1
votes

Thorough search of this site did find my question (from different user) but there are no answers so I would like to ask myself:

Background: Using Apache Cordova 4.x and Visual Studio 2013 (all latest updates). Made some apps - work fine on Android and other platforms - deployed successfully to Windows Phone 8.1. Uploaded bundle to phone store and there is a problem with the packaged application id not matching what the store expects.

Details: the problem is that the store named my app (reserved previously) as "12345myname.appname" but in Config.xml the app id is "com.myname.appname". Renaming the widget id or appid or package id to 12345myname.appname" fails because of this: Error 48 File content does not conform to specified schema. The 'Id' attribute is invalid ... 'http://schemas.microsoft.com/appx/2010/manifest:ST_ApplicationId' ...

I know what this error is but I've exhausted all possible means to get around it (create.js from cordova has the right regex - no need to change it, dropping appx manifests in res/native/windows, directly editing the appx manifests, using additional config files, etc...) nothing works. I must be missing something absolutely obvious.

The vs:platformspecific settings does contain the correct store publisher id and appid but this is somehow not been used to build the package, I assume as a post-build examination of the manifests show the incorrect store id on the package even if I override it on a custom manifest (custom manifest gets ignored upon repackaging the bundle)

Can anyone provide some insights? It is starting to sound like there is something wrong with either Cordova or VS building the bundle but I presume the problem is me and something I am not doing.

2

2 Answers

3
votes

Well, after quite a serious headache for something so simple (in the end) I did find the answer to this problem. The exact answer can be found right here (http://www.spdoctor.net/Pages/article.aspx?name=Using-Visual-Studio-Tools-for-Apache-Cordova) and credit goes to that article - many thanks!

In short... after you build your universal solution (WP8, WP8.1 and Windows 8.1) go into the BLD/RELEASE/PLATFORM/WINDOWS folder and you will find a "cordova.sln" Visual Studio solution. Open that in a Visual Studio (ignore your own solution for now, just open that one separately) and you will see a shared universal project containing the three target Windows platforms.

Each project target has a manifest file. Double click then to open up in design mode (do all three manifests) and go to the packaging tab, just like a native app. In there, change the name of your Application id to the proper store id (12345You.YourApp).

Then use visual studio (right-click one of those 3 projects, say for instance the Windows Phone 8.1) and select the STORE option then associate and create packages for the store - create a bundle package and upload that to the store. Problem solved and, this does not mess your own project if you have an android or IOS target as well.

As the author points out, there are some bugs at play here with Cordova 4.x and VS CTP 3.1 so this seems to be the only way to fix this for now. I had already installed the Intel XDK too and had my app built there successfully :) I was one step away from entirely giving up...

Really, this could be documented a bit better but well, I don't want to complain... I am totally new to Cordova so I may just have totally missed an obvious explanation somewhere... This is CTP/Beta too so I will give it a pass...

1
votes

The easiest way is add this line:

<preference name="WindowsStoreIdentityName" value="YOUR_ID" />

At the end of windows platform tag in config.xml