Closed DennisSmolek closed 1 year ago
I'm trying to recover being able to build from my main repo
So it worked before and does not work now any more?
and not having to open the solution in the platform every time.
What exactly does that mean?
What is your environment information? As you are using Ionic, running ionic info
will give some nice and helpful output.
Having the exact same issue. Using Cordova 7.1.0. Getting this message on Windows 10:
MakeAppx : error : You can't add both "C:\projects\cordova-blank\BlankCordovaApp1\BlankCordovaApp1\platforms\windows\build\windows\debug\x64\win10\Upload\AppxManifest.xml" and "C:\projects\cordova-blank\BlankCordovaApp1\BlankCordovaApp1\platforms\windows\build\windows\debug\x64\win10\ilc\AppxManifest.xml" to the output file as "AppxManifest.xml". [C:\projects\cordova-blank\BlankCordovaApp1\BlankCordovaApp1\platforms\windows\CordovaApp.Windows10.jsproj]
After upgrading cordova to 8.1.2, the message is still there, but now it won't break the build and the program runs.
So this problem is "fixed" for you @sinapis? What version of Cordova Windows were you using? What about your @DennisSmolek, did upgrading Cordova CLI help you as well?
I currently can't reproduce the error message you are reporting, so it is very difficult to investigate. I need more information or best a reproduction project.
So, previously, I was able to work in the same Visual Studio as my core repo. In my case using Ionic. Running tests, builds, etc. was all handled using the default Ionic setup.
I got a different Windows machine, pulled the repo and got nothing but headaches.
So a build that worked perfectly for iOS and Android refused to build in Windows.
What I found is that if you attempt to build or run the app from the root project some configuration/script/setup always blocks it.
So we do a standard build for all platforms. I pull the repo into Windows and do a Cordova Build. VS is great and you can do it from VS or with Cordova directly.
BUT You then have to open the generated solution in the windows platforms folder, open that, and then use that to generate/run your actual application. Attempting to do it from the root always fails.
Can you elaborate that?
I was able to work in the same Visual Studio as my core repo. In my case using Ionic.
Do you mean a normal Ionic project here?
So a build that worked perfectly for iOS and Android refused to build in Windows.
What kind of build - cordova build windows
run in the main folder of the Ionic project?
I pull the repo into Windows and do a Cordova Build. VS is great and you can do it from VS or with Cordova directly.
So opening the Ionic/Cordova project in Visual Studio and then do a build using the Visual Studio Tools for Cordova?
BUT You then have to open the generated solution in the windows platforms folder, open that, and then use that to generate/run your actual application. Attempting to do it from the root always fails.
How does it fail, do you see any error message?
What Visual Studio version are we talking about here? Do you have both the version from your old machine and the new one where the problems started?
I think what you describe might be related to an update of Visual Studio. Can you please answer these questions above?
If you have the time, you might try to cordova platform rm windows
and then cordova platform add github:apache/cordova-windows
to use the current master
of this repository where I commited a fix for that specific problem.
Sorry, let me elaborate the best I can, this is a year old and some of the details are a bit rusty to me.
Ok, at one point I followed the Visual Studio Guide/Docs for a Cordova/Ionic project. I'm not sure it's this exact one or not, but essentially it was a new blank project from their templates.
I was running Visual Studio. I can't remember if we started with 2015 or 2017 (sorry)
I could then click debug/run from the toolbar. I would see the build scripts run and any issues would show up inside visual studio.
I used this generated package as the basis for our core repo.
Then the bulk of development continued on my Mac or my teammates machines (Mac/Linux)
When on the other machines, in the root project folder, using terminal you can run ionic cordova build ios
ionic cordova build android
etc. Then open up Xcode or Android Studio.. Or of course use the browser and ionic serve
I would commit to a branch, then open up my Windows 10 Image, open VS, pull the branch, and then could debug or run the "build for store" etc. All of my configs like permissions and what not were all on the root project folder in a VS solution.
Windows 10 did an update and my Image got borked... So I did a totally new, 100% fresh Windows install.
Installed VS 2017, Taco, All the tools as before.
Pulled the Repo.
I can no longer build/debug/run/etc from inside visual studio on the root project, when I do I get the listed error above:
MakeAppx : error : You can't add both "C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\build\windows\debug\x86\win10\Upload\AppxManifest.xml" and "C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\build\windows\debug\x86\win10\ilc\AppxManifest.xml" to the output file as "AppxManifest.xml". [C:\Users\dennis\Source\Repos\showman-ionic\platforms\windows\CordovaApp.Windows10.jsproj]
I started to FREAK OUT as the bulk of our users use the store or side-load version of our app and I couldn't get it to build at all.
I tried all sorts of stuff, but ultimately, what works is to open the root in the Windows Command Line and run:
ionic cordova build windows --release -- --archs="x64"
NOTE Because we had AOT/compile issues somewhere in the past 6 years, the solution when building from the command line was a more verbose line. Our actual build call is:
ionic cordova build windows --release --aot true --environment prod --output-hashing all --sourcemaps false --extract-css true --named-chunks false --build-optimizer true -- --archs="x64"
This builds/updates the Windows platform folder with the compiled JS/etc and creates the Windows10.jsproj
I then open theWIndows10.jsproj
in VS, and then am able to debug/run/deploy.
You asked about re-installing cordova-windows
as you had a fix, when did you release it? After I posted this issue? I'm about to do another fresh Windows Install and will be trying all this again..
Thanks for the explanation, now I can retrace what you were doing.
You asked about re-installing
cordova-windows
as you had a fix, when did you release it? After I posted this issue? I'm about to do another fresh Windows Install and will be trying all this again..
My assumption of this being caused by a new VS version were wrong, so the last paragraph of what I wrote does not apply any more.
But in general, quite often removing and readding a platform might fix things for Cordova projects that are in a strange, broken state. So cordova platform rm windows
and cordova platform add windows
might sometimes help.
Hey @DennisSmolek and @sinapis - is there still something we should investigate here or can I close this issue?
We are archiving this repository following Apache Cordova's Deprecation Policy. We will not continue to work on this repository. Therefore all issues and pull requests are being closed. Thanks for your contribution.
I'm trying to recover being able to build from my main repo and not having to open the solution in the platform every time.
When trying to run my (default) build I keep getting this error:
I deleted the entire build folder, it add's the files and does it every time. No Idea how to stop it or where it's configured...