Switching From VS Mac To VS Windows got "java.exe" exited with code 2 - xamarin

Hello Guys
I got an issue when switching my Xamarin.Forms project from VSMac to VsWindows!
"java.exe" exited with code 2 when deploying.
I already try:
delete bin/ obj/ folders
remove all packages and re-add them
MultiDex
Verify the path (removing special char "!##$%ˆ&*(-_" etc..)
If you got an idea, tell me ;)
Regards,

If G Clovs solution doesn't work, then:
make sure the netstandard on your mac is exactly the same on your Windows pc.
Make sure you have the same Android SDK downloaded on your Windows - through Tools Menu > SDK manager.
If you are using stable channel for vs for mac updates, then make sure you are not suing the preview of budget packages on your Windows.
Apply the same logic in 3 for preview channel.
To avoid all these issues:
Simply go to vs for mac 2019, change to stable build and update the vs for mac to latest.
Update all android SDK and build tools to say v28
Update all nugget packages for the two projects and build successfully.
Go to vs 2019 and update vs to latest.
Repeat step 2 for vs.
Deselect preview in nugget package manager, and update nugget packages in the two projects.
Build successful.

Try the below steps, it was working for me.
Open Visual Studio in Windows
Open your Solution
Find for "Resource.designer.cs" file in Android Project and delete it
Remove obj and debug folders form PCL and Android project
Clean and Rebuild
Happy Coding :)
Kishore Kumar

With turning third page of google, I didn't find any answer.
But I found the answer by my own.
The issue was comming from the Android.csproj and the Keystore Path.
It was set to my Mac Path even if I had already changed it on
VSWindows AndroidProject => Properties => Signin
So I removed this lines on Android.csproj (edited with third text editor):
<AndroidKeyStore>True</AndroidKeyStore>
<AndroidSigningKeyStore>YourMacPath/Alias.keystore</AndroidSigningKeyStore>
<AndroidSigningStorePass>Password</AndroidSigningStorePass>
<AndroidSigningKeyAlias>Alias</AndroidSigningKeyAlias>
<AndroidSigningKeyPass>AliasPassword</AndroidSigningKeyPass>
On debug & release Part.
Then you can edit them on VS Windows.
Hope I helped someone.
See ya

Related

Visual Studio Setup Project deletes just upgraded files

I'm working on an old Visual Studio 2008 project which had a setup project. I have upgraded everything to VS2019 made the changes in the code, increased the version, added a few files and made the setup.
A clean install is working perfectly.
When I first install the old version using the setup build in VS2008 and then run the new setup to upgrade this, things go freaky.
The new setup will install all new files, and just before ending it removes all files that were overwritten. Only the files that did not exist will remain.
For example, the old setup places these files in the program file folder:
- program.exe v1.0
- lib.dll v1.0
Then the new setup will install these files, overwriting the old ones:
- program.exe v2.0
- lib.dll v2.0
- other.dll v1.0
- info.txt v1.0
Just before ending the install and enabling the [close] button, the folder contents changes to:
- other.dll v1.0
- info.txt v1.0
I have checked this on multiple computers (Win 10 down to Win 7) and used a filemon tool to make sure that the new files are actually installed and then removed. The Event log only shows a successful install.
Starting the new setup again and choosing 'repair' will work and leave the files. So that is a workaround, but not the nicest one for many users.
A test with two VS2019 setup builds with different versions work correctly. The old VS2008 setups also worked correctly. So it appears to be an issue when upgrading a setup build with VS2008 with a setup build with VS2019.
Does anybody know how to fix this so that installation does not remove the files?
Okay, I had seen some VS2010 questions which looked the same. Solutions there seemed to be manually editing the msi file after the build. Far from optimal and I would assume that it was fixed by MS in VS2019.
Turns out that they have not "fixed" it, but allows Backward Compatible IDs to be used. I suddenly saw this option when going through the options panel again. Change to True:
And this does solve my issue.
More info in this answer
This question can be deleted if someone thinks it's a duplicate. When you think it's helpfull I'll accept my own answer here for archive sake.

Xamarin.Forms Tasks don't match targets

I was working fine with in my project ,the once I updated my Xamrain.Forms to 3.0, all of a sudden I got this error :
Has anyone come across this issue? I'm kinda lost here, thanks .
Issue with my project was that, Project.Android and Project.iOS's Nu Get packages Xamarin.Forms's versions were different, so I had to update all Xamarin.Forms library in each project to the same version.
Clean, Build and it solved the issue.
Please ensure that all projects reference the same version of
Xamarin.Forms
So make sure that the statement above is correct, clean your solution and just in case restart the Visual Studio after that.
EDIT:
It seems to be a quite popular issue after upgrading to Xamarin Forms 3.0, if the steps above didn't resolve it please consider:
Delete all /bin, /obj and /packages folders within the solution
Check csproj files for duplicated Xamarin Forms references
Re-add Xamarin Forms NuGet packages
this should help:
You need to click RMB on each (Droid, IOS, UWP)-project -> Nuget -> and then update Xamarin Forms for every project to the same version, even "solution".
I would not call it a solution, but uninstalling the app from the device prior to every build was the only way forward I have found.
I tried all of the above to no avail.
What helped me was the following:
Close Visual Studio (for mac in my case)
nuget locals all -list
Delete all nuget cache folders
Restart visual studio and try again.

MSTest cannot find TestAdapter.dll

I'm using the built-in Visual Studio test tools (Test -> Run -> etc in the menu). I just started having a problem where I get the following error when I try to run tests
[3/29/2018 1:39:14 PM Error] System.IO.FileNotFoundException: C:\Users\brubin\AppData\Local\Temp\VisualStudioTestExplorerExtensions\MSTest.TestAdapter.1.1.18/build/_common/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll
at Microsoft.VisualStudio.TestWindow.Controller.TestPlatformProvider.PerformShadowCopy(IEnumerable'1 testExtensions)
That's followed by some errors that say
Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
When I look at the folder C:\Users\brubin\AppData\Local\Temp\VisualStudioTestExplorerExtensions\MSTest.TestAdapter.1.1.18/build/_common/, there are no files in that folder. However, I haven't knowingly changed anything about my test setup and this was working several days ago, so I don't know why it would have stopped working.
My projects are using the MSTest.TestFramework (MSTest V2) version v1.2 NuGet package.
One thing I noticed that may have caused this problem is that if I go to Tools -> Extensions and Updates, I see that my Microsoft Visual Studio Test Platform was updated a few days ago, on 3/23 (I think that's when I installed a Visual Studio update). However, if that broke something, I have no idea where to look to see what's broken, or how to fix it.
For me, clearing the VisualStudioTestExplorerExtensions folder and restarting Visual Studio (as per this github issue) did the trick. In my case, it contained two folders for different versions of MSTest.TestAdapter, I don't know whether or not that's relevant.
For anyone else who stumbles on this question, the problem was caused because a few of my test projects didn't have the MSTest.TestAdapter NuGet package included. I added the MSTest.TestAdapter package to all of my test projects, and the problem seems to be solved permanently now.
I spent the whole last week trying to solve the same issue. Only yesterday did I realize that running tests from the console is a time saver. Much to my surprise, I've just moved all my project -which was inside a "OneDrive" folder, to a different location. Now, it works like a charm! All my tests run from the Visual Studio IDE. I don't know if moving the files had anything to do with it, but you can give it a try.
Reinstalling all solution's Nuget packages fixed this issue for me.
Please run this command on the package console:
Update-Package -reinstall
then try again, or restart VS, then try again.
Reference: https://ardalis.com/force-nuget-to-reinstall-packages-without-updating/
Its a bug in Visual Studio. Upgrade the Visual Studio to version 15.7.
https://developercommunity.visualstudio.com/content/problem/222892/filenotfoundexception-microsoftvisualstudiotestpla.html
Yes you need to update "MsTest.TestAdapter" on all testprojects. The easiest way is to rightclick on master solution and click on manage nuget-packages. Then select " installed " tab and see if there is installed TestAdapter on each testprojects. If necessary you can update TestAdapter to newest version. Then restart Visual Studio and it should work.

Package Installation Error Microsoft.NetCore.UniversalWindowsPlatform.5.0.0

I just did a fresh install of visual studio community edition.
When I start a new project and choose 'Blank App (Universal Windows)' I get this error during project creation:
Package Installation Error
Could not add all required packages to the project. The following packages failed to install from 'C:\Program Files (x86)\Microsoft SDKs\NETCoreSDK':
Microsoft.NetCore.UniversalWindowsPlatform.5.0.0: Package restore failed. Rolling back package changes for 'AppTest'
Any ideas what the cause of this error can be?
I installed all the Universal Windows App Development Tools:
- Tools (1.3.2) and Windows 10 SDK (10.0.10586)
- Emulators for Windows 10 Mobile (10.0.10586)
- Windows 10 SDK (10.0.10240).
What am i missing. How can I solve this issue?
Sometimes nuget fails to install the UniversalWindowsPlatform package. Search for "Microsoft.NETCore.UniversalWindowsPlatform" nuget package and install it.
This is not an answer, I have the exact same issue and I have found other people with the same issue on the web, no one has come up with a solution yet.
This is upon creation of 'any' UWP project type, blank, templated, VB, C#.
This dialog pops up:
I have already found and tried all of the steps mentioned by Jay Zuo. This is actually for a slightly different issue, the dialog is exactly the same apart from the bit, where we have ': Package restore failed.'
They are getting ': Solution is not opened or not saved'
None of the steps on that post help resolve this issue.
I have tried restoring VS, Reinstalling the Windows 10 SDK, resetting VS using the various options to reset user data, environment etc, made sure the path to the SDK files exists.
Nothing has worked and my VS2015 Community is utterly useless right now for working on UWP projects. This is a new Windows 10 / VS install (VS on insider fast PC has no issue at all but I need this one on production build).
I am posting as an answer as I do not have enough points to comment but starting a new thread seems daft as this is the exact same issue, I just want to add more detail to it.
I had the same probem after a clean install of OS/Updates/VS 2015 Update 3 + Xamarin update. I created a Universal 'Blank XAML App (Xamarin Forms Portable)' During creation I received same error.
In the Nuget Package Manager Console pick AppX.UWP, then run:
Install-Package Microsoft.NETCore.UniversalWindowsPlatform
Restart VS and create a new project, error does not come back.
So after much back and forth between myself and an MS rep on their forums I did actually manage to resolve this.
The forum link is here
I did actually need to reset my VS installation to try and get a clean install.
Then the actual error reared its head. In my case it was Nuget caching corrupt packages (these are not cleaned by a VS reinstall).
The link that helped me resolve it in the end can be found here on Stack Overflow
What helped me was to update the UniversalWindowsPlatform package in nuget to 5.1.0. Then all went smoothly the next time I created UWP project.
Upgrading the package Microsoft.NetCore.UniversalWindowsPlatform.5.2.2 worked for me...
After facing a similar problem with Microsoft.NetCore.UniversalWindowsPlatform.5.2.3. I found a solution which might help someone. I navigated to my ProgramData\Microsoft\VisualStudio\Packages\Microsoft.Net.CoreUWP,version=1.0.4 and ran the netfx_NETCoreUWP.exe. It did resolve my problem
Just as a reference...
My NugetPackage "'Microsoft.NETCore.UniversalWindowsPlatform" disappeared from my project references. It showed up as installed in NuGet. I uninstalled and re-installed without success. I restarted Visual Studio and re-installed and the package reappeared :-) !

Issue with building the OpenCV sln file

I'm currently having trouble with building the OpenCV.sln file after generating them in Cmake. I am currently using windows 7 64 bit OS and VS 2010 Express. Also the OpenCV version I am using is 2.4.2 Once I open the OpenCV.sln file it would inform me that "solution folders are not supported in this version of the application".
Hitting the F5 button to build the .sln file would only yield in 8 successful build with the others tagged as failures. Is there anyway to fix this problem? thanks!
In the newest CMake there is a 'use solution folders' option. So before you generate, go to enable->solution folders and uncheck it.
Problem
Solution folders are only supported in the non-express versions of Visual Studio. I had the same problem when I first tried to install mine.
Source: http://social.msdn.microsoft.com/Forums/en/Vsexpressvc/thread/2a8e62c8-e14f-4027-8704-7d943c99303e
Solution
I used this tutorial to get OpenCV to work.
It's not the latest version, but it worked marvelously well.

Resources