Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 10 UWP App build issue with MakeAppx

I am not sure what is causing this error and I have been researching it for hours. I am using Visual Studio 2015 Update 3. I am building a Windows 10 Universal (UWP) app that will be uploaded to the store. I already have my dev center account and it is associated with my app. Finally, when I right click on the project and select store > create app packages I get this error:

error 80080204: The package with file name "PacTracMobile.Windows10_1.3.0.0_ARM.appx" and package full name "OdenIndustriesInc.9510B3DEAC6_1.3.0.0_arm__bdbevzbp0ydz4" is not valid in the bundle because the bundle also contains the package with file name "PacTracMobile.Windows10_1.3.0.0_x86.appx" and package full name "OdenIndustriesInc.9510B3DEAC6_1.3.0.0_arm__bdbevzbp0ydz4" which applies to the same processor architecture. Bundles can't contain multiple app packages for the same processor architecture, or an architecture-neutral app package with any architecture-specific app package.

This error is with file MakeAppx for the record. I am trying to build x86, x64 and ARM. When I am in debug, I can build, deploy and test just fine, with no errors. However, when I select to build my app packages, I get this.

Note, Visual Studio is in Release mode, Any CPU. That said, when I select to create app packages, in the first popup window, I have selected to build each three platform, in release. My screen looks just like this:

Exactly how my build looks, except with my package output path

When I click create, it starts to build and eventually, I get the error above.

Any thoughts?

Thanks!!!

EDIT- For the record, the screen shot I show above, I got from these instructions from Microsoft. I have and am following these instructions exactly! MSDN Building UWP apps

UPDATE- If, in the window in the screenshot above, I deselect x84 and x64 (which is not ideal since I want all three) and just do ARM, I don't get any errors and package completes. Based on some reading, I suspect that if I do one by one (ie, run again with only x86 selected), it will build fine but I will be left with three app packages instead of all in one. So, this seems to be related to trying to build all three at one time and package into one bundle which is sort of what the error is eluding to but again, the error nor anything I read online explains how to fix the issue.

like image 551
Michael Bedford Avatar asked Jan 12 '17 04:01

Michael Bedford


People also ask

What does makeappx EXE do?

MakeAppx.exe also extracts files from an app package or bundle and encrypts or decrypts app packages and bundles. This tool is included in the Windows 10 SDK and can be used from a command prompt or a script file. For information about how to use MakeApp.exe to package a desktop app, see Package a desktop app manually.

How do I use MakeApp in Windows 10 SDK?

This tool is included in the Windows 10 SDK and can be used from a command prompt or a script file. For information about how to use MakeApp.exe to package a desktop app, see Package a desktop app manually. If you used Visual Studio to develop your app, it's recommended that you use the Visual Studio wizard to create your app package.

What is the installation type of a UWP app in appx?

In an AppX package you will find: App block map which is the app package’s block map file ( AppxBlockMap.xml) What is the installation type of a UWP app? The UWP app is installed per-user. Users don’t have any knowledge of what was installed for any other user. Where the UWP apps get installed?

Does makeappx create an app package upload file?

Note that MakeAppx.exe does not create an app package upload file (.appxupload or .msixupload), which is the recommended type of valid app package for submissions to Partner Center. The app package upload file is typically created as part of the Visual Studio packaging process, although it can also be created manually.


3 Answers

After alot of troubleshooting on this issue, I had to involve MS support to figure it out. The root cause of the issue is that one of the previous architectures was building a latter one so when it came to build the latter one, it was failing because it was already built by the previous.

In other words, you will see in the screen shot above that I have the boxes checked to build all three (x86, x64 and ARM). What we found was that x86 was actually building ARM. So, when ARM went to build, it threw the error because the package was already built.

Now for the solution, MS support helped to identify a bug with VS and how it handles your .csproj file. We confirmed both in my case, and MS support reproduced on a new project, that the .csproj file can get out of sync with what is shown in the UI under Configuration Manager. So, in other words, my configuration manager in VS showed that x86 was actually targeting x86...or so it should have. However, when we opened the .csproj file in notepad, we found that x86 was actually set to ARM.

We also noted that restarting VS does not sync them back up, nor does physically changing the configuration manager to ARM and then back to x86. It is almost as if it gets out of sync and then no longer tries to update it.

So, the only fix was to manually correct/edit my .csproj file to show the correct architectures. Once I did this, everything built just fine.

This is what you want to look for in the csproj file

<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>

Notice that the

 <PlatformTarget>x86</PlatformTarget>

matches the config. Before, this said ARM even though the config item was for x86

like image 122
Michael Bedford Avatar answered Oct 07 '22 02:10

Michael Bedford


when the package with multiple architectures is generated, they must have some same compilation configurations. For example, if Release x64 has 'Compile with .NET Native tool chain', Release x86 must also have the flag. Or generate a package for each architecture.

like image 24
dgzornoza Avatar answered Oct 07 '22 02:10

dgzornoza


The conflict can result from the package that process has created before. You may try increasing your version number to 1.4.0.0 and try again.

If the issue persists, you can create 3 separate package bundles checking different architecture. Just upload all the appxbundles to your package section of your submission in Dashboard.

The issue has ever been reported here which is closed as fixed.

like image 44
Zhendong Wu - MSFT Avatar answered Oct 07 '22 02:10

Zhendong Wu - MSFT