Search code examples
adal

Cannot submit app to the Windows store after adding cordova-plugin-ms-adal


I added Azure AD authentication to my app using cordova-plugin-ms-adal. It works well, but when submitting the package to the Windows Store, I receive the following error

You cannot submit pre-compiled .NET Native packages.

Also, when building it, I receive the following:

C:\Program Files (x86)\MSBuild\Microsoft.NetNative\x64\ilc\IlcInternals.targets(934,5): warning : Your application is missing a Runtim e Directives (rd.xml) file. Runtime Directives are used to describe the dynamic behavior of your application and control the .NET Native optimizer. It is recommended to have at least one rd.xml file in your project. [C:\dev\projects\first\platforms\windows\CordovaApp.Wi ndows10.jsproj]

I receive none of them when I remove the plugin. I am using Visual Studio 2015 and building for Windows 10 with cordova 6.4 and cordova-windows 4.4.3. Might be worth to mention, I am building the packages using this flag --archs="x86 x64 arm" because I am also using a sqlite plugin.

Thanks.


Solution

  • With more research on the error and some help, the issue is actually caused by trying to upload the appxbundle instead of the appxupload. And the reason why I was trying to upload the appxbundle is that there were no appxupload file generated.

    The fact that no appxupload is generated is an issue when building for UAP in [email protected]. To generate the appxupload, I had to modify the build.js to add the StoreUpload option.

    if (shouldBundle && index === configsArray.length - 1) {
        otherProperties.CordovaBundlePlatforms = bundleTerms;
        otherProperties.UapAppxPackageBuildMode = "StoreUpload";
    } else if (shouldBundle) {
        otherProperties.CordovaBundlePlatforms = build.arch;
    }
    

    Hope that helps!