Build failed with error Remotebuild requires your projects to use cordova-ios 4.3.0 or greater with Xcode 8.3. Please update your cordova-ios version - ios

I am aiming to deploy a mobile application to the iOS platform using codes developed in Visual Studio for an Android phone. I am unable to open the Visual Studio file on my Macbook (macOS High Sierra ver.10.13.6) as Visual Studio here does not seem to support .jsproj files. As such, I have attempted following the instructions in the link below to run a remotebuild on my mac while debugging codes and seeing an iOS simulator on my Windows computer.
https://learn.microsoft.com/en-us/visualstudio/cross-platform/tools-for-cordova/first-steps/ios-guide?view=toolsforcordova-2017#run-on-simulator
I was able to get the remotebuild running, however, I came across the error where it required my projects to use cordova-ios 4.3.0 or greater with Xcode 8.3. As my windows computer does not have Xcode, I turned to my macbook and tried updating and adding the Cordova iOS platform through the terminal, where it said "Current working directory is not a Cordova-based project." I have searched the error up and it said that it required my Visual Studio project to be open, which I am unable to do so as my file is not supported in the Mac version of Visual Studio.
The iOS version in my Windows Visual Studio is currently 4.2.0 and I am unsure how to get about updating it. I have seen the link below but in only applies to Macbook, where I cannot open the Visual Studio project file.
Install specific version of Cordova CLI in Visual Studio 2017
I have installed node.js as well as Git, also attempting to include/update the Cordova iOS platform through the command prompt (Once again unsure if that was the method, but I tried), however, the command prompt did not recognise the update to cordova. Under the toolset in Visual Studio, I have tried ticking on the checkbox under Cordova platforms to take the latest patch, where ~4.2.0 appears, but still does not update.
I am still new to coding and things seem very foreign to me, if I have missed out anything vital or am doing something fatally wrong, please do enlighten me.

Related

Cannot get list of iOS simulators in Debug Target from Visual Studio 2022 on Windows

I have the problem that I'm not able to see the list of iOS simulators in Visual Studio Debug Target on my Windows PC
I've just made a total upgrade of my Xamarin development environment including now latest VS 2022, latest OS on my Mac, latest XCode version 14 and latest version of Xamarin on my PC and Mac. I have successfully paired to my Mac from Visual Studio.
On my Mac I've just tried to refresh the list of Debug devices as described in Microsoft Docs:
Delete your ~/Library/Developer/CoreSimulator/Devices folder.
Run killall -9 com.apple.CoreSimulator.CoreSimulatorService.
Run xcrun simctl list devices.
.. but still no result. All I can select in my Debug Target is Local Device, Remote Device and Simulator.
Before this upgrade I had no problem seeing all the simulators.
I will really appreciate if anybody have some good ideas of what I can do to solve this.
Following is my list of installed components from VS About box:
Xamarin 17.3.0.296 (d17-3#a0ff24b)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.
Xamarin Designer 17.3.0.208 (remotes/origin/d17-3#e4f67afef)
Visual Studio extension to enable Xamarin Designer tools in Visual Studio.
Xamarin Templates 17.2.28 (9b3d244)
Templates for building iOS, Android, and Windows apps with Xamarin and Xamarin.Forms.
Xamarin.iOS and Xamarin.Mac SDK 15.12.0.2 (87f98a75e)
Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support
Please be noted that XCode 14 is not yet supported in Xamarin.iOS or .NET MAUI, you need downgrade your Xcode version to 13.4.1 and could download it from the downloads page in the Apple Developer Portal. For more information, you can refer to https://github.com/xamarin/xamarin-macios/issues/15954
Update:
Xcode 14 is currently supported and if there are any other issues, please continue to post back to the GitHub.Thanks!
I have this same issue even after installing VS 17.3.6. I have no list of iOS simulators and I get a warning that this version of Xcode is not supported.

visual studio 2022 installs monoframework 6.12.0.174 on mac, then iOS Simulator fails

I use Visual Studio 2022 on Windows for Xamarin development for Android & iOS. I use a Mac Mini with M1 for the iOS builds. All has been working fine for over a month. A few days ago I allowed the MAC to perform an update. Today when I tried to build for iOS, the Pair To Mac dialog said there was a monoframework mismatch and offered to install monoframework 6.12.0.174 on the MAC. Initially I chose Cancel,and then rebooted both machines. The same error occurred when I tried again. This time I allowed the install. After the install completed, every time I try to use the iOS Simulator it hangs as soon as it appears. I would appreciate some direction. I do not know how to fix it and I do not know how to back-out the mono install on the MAC. Please help.
Solution: I updated Visual Studio & Visual Studio for Mac to the current versions. Then found in the following in the Visual Studio ReleaseNotes:
Known Issues
Deploying an iOS app with Visual Studio 2022 and Apple Xcode 13.3 results in a Remote iOS simulator window with a blank/black screen. Workaround: Disable the “Remote Simulator to Windows” check box in the iOS Settings under the Tools - Options menu. The iOS app should deploy correctly on the macOS host.
Following those instructions I disabled the “Remote Simulator to Windows” check box in the iOS Settings under the Tools - Options menu. The iOS app then deployed correctly, but on the macOS host, no longer can it deploy on the Windows machine from the Mac build host as in prior versions.

Xamarin App running in Ios simulator using visual studio

I am facing the issue to run the xamarin app in IOS simulator. Whenever i am trying to run this app it was asking me to add or pair the Mac. Since I dont own the Mac I tried to install Xamarin.Ios in windows. In this process i need to install the XCode in my windows 10 Os. First of all i am unable to download the Xcode tool from Apple portal with valid credentials. I followed the below 2 links but no luck to download and install the Xcode. Could you guys please help me the easiest solution to download install the Xcode to do the next level of run the App in windows.
https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/windows/?pivots=windows
https://apps.apple.com/us/app/xcode/id497799835?mt=12
Bottom line is that iOS apps must be build using a licensed Mac OS, period. Visual Studio for Windows does not actually build the iOS app, what it does do is connect to a Mac (which must have XCode installed) and facilitate a remote iOS build via XCode. However, if you have a Mac, you can build both iOS and Android code directly on your Mac using Visual Studio for Mac. Yes, it is frustrating that you must have access to a Mac OS to build iOS apps, but this is a requirement and there is no way around it.

Can't get Visual Studio to target the correct Android version

I have a problem getting Xamarin.Android to target the newest version of Android.
The problem arised when I tried installing the Xamarin.GooglePlayServices.Maps NuGet package, that required me to run at least Android 8.
From my Android SDK manager, I can see that Android 8 and 8.1 is the only SDK platforms installed:
However, when I start a new project in Visual Studio 2017, and go into the project properties, and extend the Compile using Android version dropdown, it's populated like this:
So here I can choose only 7.1 (that is marked as latest platform), and 8.0 and 8.1 is marked with (Requires installation). Android 7.1 SDK that VS uses is not even installed on my machine.
So the questions is: What do I have to do to select Android 8.1 as the Target Framework inside Visual Studio?
What do I have to do to select Android 8.1 as the Target Framework inside Visual Studio?
In your VS, Tools->Android->Android SDK Manager, you will see Android SDK for VS, it default path is C:\Program Files (x86)\Android\android-sdk.
In your AS, Android SDK's path is C:\Users\user name\AppData\Local\Android\Sdk
Now, you can change the VS's Android SDK's path to C:\Users\user name\AppData\Local\Android\Sdk, but we don't suggest you do that, it may cause VS compilation errors at some point, and by then you cannot find the cause of the problem.
So, you can download the Android 8 from VS again.

APK fails to be installed on any device

I'm new in the Xamarin Development world so I installed Visual Studio 2017 with all the needed cross compiler features.
After downloading and updating the SDKs for Android API 23, 24, 25 and 26 and some corresponding emulator images I got the emulators starting up.
I created a base Xamarin Android App within VS, compiled and deployed it to the simulator.
By deploying/installing the generated APK to the simulator I get the following error:
Failure [INSTALL_FAILED_INVALID_APK: Package couldn't be installed in /data/app/BlankAndroid.BlankAndroid-1: Package /data/app/BlankAndroid.BlankAndroid-1/base.apk code is missing]
It doesn't matter which SDK I choose as “Target Framework” or which Simulator I choose (Android 6, Android 7 or 7.1). The result is the same: The apk is not installed, but the “Mono Shared Runtime” are present and will be updated.
I figured out that the created apk file does not contain a file “classes.dex” or any oder dex files just some ressources. A file “classes.zip” in the directory “obj\Debug\android\bin\classes” with the generated java classes out of my C# is present. These files should be compiled with the DEX-Compiler to the classes.dex file, when I understood correctly.
Even other sample projects from the Internet have exactly the same result.
What do I do wrong?
The problem got solved by fresh installing the Android SDK and all related components. It seemed to have a SDK missmatch between an old Google Android SDK and the new installed Xamarin Android SDK.
I faced the same problem and tried many solutions from the search in web but this one to an extent solved that deploy failure issue.
In the emulator, open settings -> Apps -> Uninstall your app if it is listed
Deploy the app from visual studio again.
This solved the problem that said base.apk is missing.
Try setting your project back to the current recommended defaults. Remove all of the following properties from the .csproj file:
AndroidEnableMultiDex
AndroidDexGenerator
AndroidLinkTool
AndroidDexTool
This will let Xamarin.Android pick the current latest default values, this apply for Visual Studio for Mac and VS 2017-2019

Resources