I have a Xamarin iOS and Android project with a dotnet standard 2.0 library that is being shared between the two operating systems. When trying to run my iOS project, the project build fine and doesn't give any errors but Rider cannot seem to deploy it to a simulator.
I will give the following error:
I thought it could be the problem what is described here, but that did not help. When running the project in VS on MacOs, the iOS project also build and runs on a simulator.
Failed to load Xamarin Forms project with .NET Standard 2.0 Lib in Rider
Can anyone help me trying to fix this, please?
You are not the only one with this problem, the problem is already reported multiple time in Riders issue tracker:
https://youtrack.jetbrains.com/issue/RIDER-15544
https://youtrack.jetbrains.com/issue/RIDER-15514
https://youtrack.jetbrains.com/issue/RIDER-15419
According to the last issue, it's fixed in Rider 2018.2, which will probably be released pretty soon.
Related
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.
I'm building a new Xamarin Forms 5 app using VS 2022 17.1.1. Everything in the project appears to be up-to-date.
I've been working on this project for a while and never had this issue. All of a sudden it just appeared today. The last action I took was to install the Plugin.InAppBilling package, thought the package in question is not used by the Plugin.InAppBilling package.
The error is as follows:
All I can see is that the shared project is using System.Numerics.Vectors version 4.5.0 and it seems to be dependency of Xamarin.Essentials which is version 1.7.1 in my project.
However, the version number of System.Numerics.Vectors seems to be 2.0.5.0 in the Android and iOS projects.
I found the GitHub issue here but I'm not seeing any clear resolution to this issue. Even though it appears to be a warning, in my case, I can no longer run the app because I keep getting deployment error to the Android Emulator or actual device. It simply refuses to deploy my app to the device/emulator. So, it's really NOT a warning in my case. It's a show-stopper. I'm a bit surprised about how lightly the Xamarin Essentials folks seem to have taken this issue on GitHub.
Has anyone actually resolved this issue? If so, what's the solution?
BTW, in my case both the Android and the iOS projects are throwing this error/warning and both use System.Numberics.Vectors version 2.0.5.0 even though the shared project has version 4.5.0 installed as a dependency undre Xamarin Esssentials.
I'd appreciate some pointers on how to make this issue disappear. Thanks.
At first, you can try to update the Xamarin.Essentials package in the Android and IOS project with the nuget package manager to the version 1.7.1.
And then, if the error is still here, you can right click the reference and remove the reference of the System.Numberics.Vectors 2.0.5.0 both in your Android and IOS project. Then download the System.Numberics.Vectors 4.5.0 in the nuget package manager both too.
With my project upon running UI Tests I get POST Failed error. I can't figure what is the cause of the problem. UITests Post Failed in Xamarin.forms, related to the same issue did not help.
On an actual device I get Instrumentation backend app installed (it runs as a server for UI Tests). But I am still getting POST Failed error.
How to fix this issue?
The problem is related to the Android OS version.
Instrumentation backend application does not work properly on new android os-es.
I created a simulator with older Android OS (Android 6.0 Marshmallow).
And ran UITests with this simulator selected in Visual Studio.
And all things worked.
Hope it will help someone who struggles with the same issue.
Old school things are better than new ones.
I am having an issue while taking a release build in android:
I am having different html files for android and ios for two components. There is no issue while building or running in develop mode.. When I am trying to take a release build this possess as an issue and not able to take the build. Is there any solution for this. Thanks in advance
I am developing a Xamarin Forms (PCL) application for IOS and Android Platform.
My Xamarin Studio version is 5.5.4 (Build 15). I am on stable channel.
My Xamarin Forms dll version is 1.3.0.6292.
I have also added a Xamarin Forms Labs reference from NuGet, v1.2.0.
Since yesterday, whenever i am building the solution, i get following error:
error : Error initializing task XamlG: Not registered task XamlG.
Any possible resolution for this error? I have tried clean and build multiple time. Even deleted the entire source code and redownloaded everything from source control but same error.
This error can occur if you have upgraded from an older version of Xamarin.Forms to a newer version. The underlying problem is that the wrong Xamarin.Forms.Build.Tasks.dll is being loaded compared with the one that the custo MSBuild Xamarin.Forms.targets file is expecting.
There is a bug in Xamarin Studio where the old build Xamarin.Forms build tasks are still used after the NuGet package has been upgraded. You can workaround this by closing and re-opening the solution.
However you say you have deleted the source code and downloaded everything again so it sounds like you have a different problem. It may be that your project is trying to use two different versions of Xamarin.Forms at the same time. I would look at your project files (.csproj) in a text editor and make sure they are all using one version of Xamarin.Forms. Check that they are all referencing a single version of Xamarin.Forms.targets and it is the same version.
This is silly.
I just recloned the project in a new fresh folder and build it from scratch and it worked. The more i am using Xamarin Forms, the more buggy and unbaked it seems. There are random issues which get fixed just by rebuilding the project. Or like Matt pointed in his answer below, by just restarting the studio. In my programming experience with different IDEs and platforms, only Xamarin seems to have these problems regularly.