Xamarin iOS: Source file is not valid UTF-8 - xamarin

I'm trying to compile and deploy an iOS app on VS 2019 (v16.10.3) for Windows, but I keep getting all kinds of weird issues. This started happening recently.
How does one resolve "source file is not valid UTF-8" errors?

Related

Getting 'Selected scheme "iosApp" does not support "iphonesimulator"' error for Kotlin Multiplatform

I am trying to run the initial example apps generated by the Kotlin Multi Platform Mobile plugin in Android Studio. I followed these steps for my environment setup. The Android Simulator runs correctly, but the iPhone Simulator does not. The Run Configuration has the following error:
Error: Selected scheme "iosApp" does not support "iphonesimulator"
When I run the configuration (ignoring the error), the iPhone simulator does open and appears to load iOS, but it never loads the "Hello, iOS" application that is in Android Studio.
What would cause this?
Version Information:
macOS 12.2.1
Android Studio 2021.1.1 Patch 2
Xcode 13.3
I fixed it with the following method.
Please close the Android Studio.
Go to ~/Library/LaunchAgents/ folder and delete com.jetbrains.AppCode.BridgeService.plist there.
Launch Android Studio with the KMM plugin again. It should work now.
From my tests, it seems that there may be multiple reasons for which we receive this error:
the root folder of the ios project has a different name than the .xcodeproject file. Sometimes it works even if they are different and maybe it matters if we change this name after the frameworks was already connected to the iOS project.
"Other linker flags" were manually copied and they were not copied using the copy button from the Connect the framework to your iOS project. This results to wrong data like:
"$(inherited)",
"-framework",
"shared\n",
instead of
"$(inherited)",
"-framework",
shared,
I managed to fix this by going into Edit Configurations on Android Studio and choosing the location of my XCode project file again. I believe this is an error of the KMM plugin in Android Studio and has yet to be fixed.
Updating Android Studio and KMM plugin worked for me.

ERROR ITMS-90475: Invalid bundle, with RAD Studio

I created an app with RAD Studio.
I'm trying to publish it to the App Store.
When I try to upload it with Transporter application I verify the package and I obtain following error:
ERROR ITMS-90475: Invalid bundle. Apps that support Multitasking on
iPad must provide the app’s launch screen using an Xcode storyboard,
or using UILaunchScreen if the app’s MinimumOSVersion is 14 or higher.
Verify that the UILaunchStoryboardName key is included in your
it.xxx.yyy bundle if you’re using a storyboard. For
details, see:
https://developer.apple.com/documentation/bundleresources/information_property_list/uilaunchstoryboardname
I found some solutions for this, but using Xcode or Xamarin. How can I deal with it in RAD Studio? I tried many ways but I just got parsing errors for the *.info.plist file.
I solved my problem creating my app from scratch directly with Xcode, without RAD Studio, as my app was very simple.

Visual Studio 2019 for Mac can not build Xamarin Forms project

New to mac programming, but I've not found anything, not a single thing about the problem I have and I really need your help.
I've created a Xamarin Forms project on my PC (Windows 10, latest VS + latest VS tooling) and I've been developing an app there for both iOS and Anroid. I've been testing it on Anroid and everything works.
Now when I'm trying to build the iOS project on my mac with latest VS and Mono i get the following error:
/Library/Frameworks/Mono.framework/Versions/6.0.0/lib/mono/xbuild/Current/Microsoft.Common.props(3,3): Error MSB4019: The imported project "/Users/michael/Desktop/Dev/Suborghttps:/github.com/meJevin/PVWeather/LRadio/LRadio/LRadio/obj/LRadio.csproj.*.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. (MSB4019) (LRadio)
I have no idea what it means and can't find anything in the internet. Help would be really appreciated. Thanks
After restarting my iPhone and my Mac a couple of times, as well as cleaning all the caches and stuff the problem seems to be gone.
Although you have now solved it, I suspect the cause was the : in the folder name in the path (Suborghttps:), as this seems to confuse the Microsoft compiler, perhaps due to the meaning of colon on Microsoft operating system file systems.

Error deploying a UWP app to an ARM device when using sqlite-net-pcl

When deploying my xamarin forms app (UWP) to the local machine, it works fine. Anyway, when deploying it to my windows device and choosing ARM build, the following error appears:
Payload contains two or more files with the same destination path 'e_sqlite3.dll'. Source files:
C:\Users***\.nuget\packages\SQLitePCLRaw.lib.e_sqlite3.v140\1.1.2\runtimes\win10-x86\native\e_sqlite3.dll
C:\Users***\.nuget\packages\sqlitepclraw.lib.e_sqlite3.v140\1.1.2\runtimes\win10-arm\native\e_sqlite3.dll
I did everything I could, including uninstalling all nuget packages and re-installing them again, nothing seems to work.
Any ideas on how to solve this?
Note: I could deploy it to the device prior to adding the sqlite-net-pcl package.

Multiple errors when creating Xamarin.Forms - Blank Xaml App (Xamarin.Forms Portable) or Android App

I using Windows 10 and am trying to create a Xamarin.Forms - Blank Xaml App (Xamarin.Forms Portable) project for the first time. I have Visual Studio 2015 Enterprise Update 3 installed and have tried uninstalling, reinstalling, and repairing multiple times.
When I create a project, I get the following errors:
"The name 'InitializeComponent' does not exist in the current context"
"Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled" - for App, Droid, UWP, WinPhone, Windows, and iOS
"The XamlCTask task failed unexpectedly..." - for UWP, WinPhone, Windows, and iOS
I tried this on my work computer and home computer and I had the same issues with both.
I have tried updating Xamarin.Forms nuget to the latest version and the created 36 errors with Droid. I also tried going to c:/users/[YOURNAME]/AppData/Local. Delete the Xamarin folder and that did not solve the issue.
I tried creating other Visual Studio projects that did not involve Xamarin and did not have any issues with those. I know the issue is with Xamarin (probably something with Android) itself, but I don't think that there is anything that I am missing from the install. I tried installing it by first installing Visual Studio, then going to Modify and adding Cross Platform. That didn't work, so I uninstalled then downloaded the Xamarin Installer. I had the same issues with both.
I created a blank Android App and that give me the warning - "aapt.exe" exited with code - 1073741849".
A blank app for iPhone does not give any errors or warnings.
Windows Phone does not give any errors or warnings either.
Any ideas of what I should check for so I can get this working?
Here is a picture of the error that I'm getting
Try updating to the latest version of Forms to get rid of the XamlC errors. Assuming you haven't updated, the template is using a modestly old version. As for the aapt error, if you have the N SDK preview installed, removing that should help. Alternatively, make certain that you have up through API 23 installed.

Resources