none
Store Certification failure for Cordova UWP App - The Application cannot include an ApplicationContentUriRule with 'all' or 'allowForWebOnly' ... RRS feed

  • Question

  • I have been having a very time consuming problem with my Cordova (Ionic) application running on Windows. iOS and Android work fine, but on Windows (UWP) I could not connect via ajax to my server, as outlined here.

    As the answer suggests, I had to add the privateNetworkClientServer to get it to work (the app is of no use without a network connection), and finally the app works, and I can communicate via ajax!

    I have also added the 

    <preference name="WindowsDefaultUriPrefix" value="ms-appx://" />

    as suggested to run in “local mode”.

    Finally, the app would connect.

    Now, I am trying to submit the update with this fix to the store, and I am getting the following..

    Error Found: The app manifest test detected the following errors:
    o    The Application cannot include an ApplicationContentUriRule with 'all' or 'allowForWebOnly' WindowsRuntimeAccess while any of the following capabilities are enabled: enterpriseAuthentication, sharedUserCertificates, musicLibrary, picturesLibrary, videosLibrary, removableStorage, documentLibrary, internetClientServer, privateNetworkClientServer.

    I am guessing it is no likeng the privateNetworkClientServer

    The store feedback gives me no idea apart from the above message.

    Does anyone have any ideas how I can proceed. I now see i need this ""privateNetworkClientServer" otherwise Windows just (completely silently) fails any ajax calls done on corporate Networks (which is where this app needs to run)

    Thanks in advance for any help!

    Monday, October 22, 2018 11:21 PM

Answers

  • Hi Peter,

    Combined with your supplementary description of the problem in SO, my guess is the same as yours: the problem may be caused by <allow-navigation href="http://localhost:8080/*"></allow-navigation> in the config.xml. 

    Restrictions on the declaration of allow-navigation in the document Added support for Windows 10 contains information(#### WindowsDefaultUriPrefix ####) give a explanation: In order to have a local context - application that is not impacted by the web-context capability restrictions, You must set this preference to `ms- appx://` and not declare any `< allow navigation->` elements with remote URIs.

    Please point out if I misunderstand.

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 29, 2018 5:47 AM
    Moderator

All replies

  • Hi Peter,

    Did you define 'ApplicationContentUriRule' with WindowsRuntimeAccess  of 'all'? If you did, your application may fail the Windows Store validation. The thread:[UWP]Work Around for Application Content URI Rule Windows Runtime Access may give you some help.

    Some information in What's New in Windows 10 for Cordova may give you some descriptions for your error:When the app manifest declares remote URIs or Web Context to have access to WinRT, then the public Windows Store will prevent on-boarding of apps that have the following capabilities declared: Enterprise Authentication (enterpriseAuthentication) ..... Private network client/server (privateNetworkClientServer) 

    If there is no any process for your issue after trying it, you could make a support ticket through your developer account to ask for help.

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, October 23, 2018 8:29 AM
    Moderator
  • Hi @Daisy, thanks for the reply.

    In the package.windows10.appxmanifest, there is the following

    <uap:ApplicationContentUriRules>
                    <uap:Rule Match="http://localhost:8080/*" Type="include" WindowsRuntimeAccess="all" />
                </uap:ApplicationContentUriRules>

    Is this what you mean above?

    This wasn't something I added myself, perhaps it was put there when the project was created (I am using Ionic, so it created the Windows project)

    I removed this, rebuild and ran the test build on my machine and it seemed to run fine (and still worked over our corp network)

    Could this above setting be the problem, and therefore all I need to o is remove it?

    Thanks in advance for any further help



    • Edited by Peter-j-c Tuesday, October 23, 2018 8:57 AM
    Tuesday, October 23, 2018 8:56 AM
  • Actually, when I build via Ionic/Cordova, it adds back the 

    <uap:Rule Match="http://localhost:8080/*" Type="include" WindowsRuntimeAccess="all" />`


    I've now added a new post regarding this here. I did on SO as more Ionic/Cordova related.

    Wednesday, October 24, 2018 2:34 AM
  • Hi Peter,

    Glad to know your application work fine.This setting should be the cause of this error. I  find some definitions for this setting which might do some help for you, as follows:

    1.uap:ApplicationContentUriRules (Specifies which pages in the web context have access to the system's geolocation devices (if the app has permission to access this capability) and access to the clipboard.)

    2.uap:Rule(Specifies which pages in the web context have access to the system's geolocation devices (if the app has permission to access this capability) and access to the clipboard.)

    3.Match(It is unique per application in the package and is case sensitive)

    4.Type (A string that specifies whether the rule is an inclusion or exclusion rule)

    5.WindowsRuntimeAccess ("allowForWebOnly" indicates that only UWP APIs created by the developer and included inside the app package will be exposed. Note that the UWP Windows Runtime class that is intended to be exposed to JavaScript must be decorated with the [AllowForWeb] attribute where it is declared;"all" indicates all allowed UWP APIs will be available;"none" (the default value) explicitly states that no UWP APIs will be exposed.")
    If I misunderstand something please point out.  

    Best regards

    Daisy  Tian      


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 24, 2018 2:53 AM
    Moderator
  • Hi @Daisy, unfortunately I am not sure is was working without the Rule.

    I didn't realise when I built it, the rule was added back. Everytime I rebuild, this rule is added back.

    I did another post at here on SO asking why the Ionic/Cordova build is adding this back to the appmanifest when I have removed it

    Wednesday, October 24, 2018 3:01 AM
  • Hi all, I am still completely stuck on this. I just have no idea what to do next. I have searched everywhere for a solution, seen many other posts on the same subject, but can find no solution.

    It is so simple what I have and want to do....

    I have a Cordova (Ionic) application that needs to make simple ajax requests to a REST (asp.net WebAPI), and for these to work on corporate networks. 

    Is this suppose to work, or does store distributed UWP just not support Cordova applications that make ajax requests?

    Any further help much appreciated.

    Thanks in advance


    • Edited by Peter-j-c Saturday, October 27, 2018 3:31 AM
    Saturday, October 27, 2018 3:30 AM
  • I really cannot find where to send a MS support request for this issue. I have once again attempted to send an email as suggest in the following...

    Please take the following action

    We reviewed your submission and identified some changes that are needed before we can publish or update the app. Please make these changes and resubmit your app. For more information, contact reportapp@microsoft.com Please include your app ID so we can act quickly.

    The last time I did this, they just sent me a link to the forums, and links that just go in circles.

    Do we get any support for the store, or do we have to use paid MS support? (which is the only other thing I could find). 

    There seems to be some serious problem here with Cordova application distributed via the store, if that application is to be run on a Corporate network.

    Thanks in advance for any help

    Sunday, October 28, 2018 1:03 AM
  • Hi Peter,

    Combined with your supplementary description of the problem in SO, my guess is the same as yours: the problem may be caused by <allow-navigation href="http://localhost:8080/*"></allow-navigation> in the config.xml. 

    Restrictions on the declaration of allow-navigation in the document Added support for Windows 10 contains information(#### WindowsDefaultUriPrefix ####) give a explanation: In order to have a local context - application that is not impacted by the web-context capability restrictions, You must set this preference to `ms- appx://` and not declare any `< allow navigation->` elements with remote URIs.

    Please point out if I misunderstand.

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 29, 2018 5:47 AM
    Moderator
  • Hi @Daisy, yes that is correct! I really am not sure how the <allow-navigation href="http://localhost:8080/*"></allow-navigation> in the config.xml got there, I always assumed it was needed for the Cordova web content to be loaded into the webview,  but now this may not be the case.

    My app seemed to run fine without it (when side loaded locally). I have rebuilt and resubmitted, so I hope this is the end of the problem (will update once I get store result)

    Monday, October 29, 2018 8:53 AM
  • Hi Peter,

    Did your app released successfully?I wonder if our conjecture is correct.

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, October 31, 2018 7:19 AM
    Moderator
  • Hi Daisy,

    yes the app is now certified and and on the store. Everything works 100% fine, and it can now connect to the server across our corporate network.

    Thankyou very much for all your help! Would not have got there without it.

    Wednesday, October 31, 2018 10:54 PM
  • Hi Peter,

    I'm glad to hear that your problem has been solved.In researching your issue, I also looked up a lot of threads, but most of them did not provide a good solution.So could you mark this thread which is very beneficial to other community members reading it.

    Best regards

    Daisy  Tian


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, November 1, 2018 1:22 AM
    Moderator
  • Hi Daisy, yes agreed. 

    I spent hours and hours going through other posts which I thought similar, but done of them helped.

    In the end, it was just the <allow-navigation href="http://localhost:8080/*"></allow-navigation> in the config.xml. that caused my problem.

    I have no idea where this came from, I thought it was just a default to allow the app to run, but removing it, everything was still fine. I marked your reply that mentions this.

    Really, if I did not have this in my config.xml, to solve my original issue, ie blocked ajax call, the two steps of

    1. Adding privateNetworkClientServer

    2. To allow the above on the store, then switching to "local mode" by adding the 

    <preference name="WindowsDefaultUriPrefix" value="ms-appx://" />

    would have been enough, and I would have had no further problems.

    But once I added the privateNetworkClientServer now made `<allow-navigation href="http://localhost:8080/*"></allow-navigation>` invalid for the store certification. So I never really needed the `<allow-navigation >`, but was getting away with it until we added the privateNetworkClientServer.

    Yes, I hope others can benefit, and get there a lot quicker than I did, once you know it is all makes, sense, but getting there was a "wild ride", but not knowing these few things was very confusing.

    Thanks again for the help!

    Thursday, November 1, 2018 1:36 AM