How to disable Shared Mono Runtime by not using the Android Options? - xamarin

I have a Xamarin project that was successfully building APKs when I was using VS 2019 v16.9
After I've updated my VS to v16.9.1, I started getting an error:
"Shared Mono runtime is enabled for (name of project)"
I tried to follow the recommendations of others who have faced the same issue but it seems that the option to disable "Use Shared Mono Runtime" is missing in the new update.
Is there any other way to disable Shared Mono Runtime?

I guess you could edit the .csproj file directly. Unload the project then make the changes in that file by hand then reload the project.

Related

Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Xamarin.Forms - VS2019

I have a Mobile App built with Xamarin.Forms
when I am trying to upgrade my project from VS2017 to VS2019
I get this error in Android Project
Invalid value 'armeabi' in $(AndroidSupportedAbis). This ABI is no longer supported. Please update your project properties
I tried to delete bin and obj folders to force the project to rebuild everything, but the error still appears
Can I get an explanation about the error above and how to solve it?
Note: the error doesn't appear in VS2017
armeabi is deprecated and your Android project should target armeabi-v7a and arm64-v8a at a minimum in your release builds destined for the Play Store.
You can directly edit your .csproj and remove the armeabi from within the AndroidSupportedAbis tags:
<AndroidSupportedAbis>armeabi-v7a;arm64-v8a</AndroidSupportedAbis>
Or you can open the Android Build settings in the IDE and it will auto-update it for you:
Targeting 64 bit architectures on Xamarin Android
It can be adjusted in 3 steps.
Step 1 - Right-click on Android Project and Click Properties:
Step 2 to 4:
Step 5 - Uncheck armeabi:
In Visual Studio, right-click on your project under the Solution Explorer and select Properties. Under the Android Options page check the Packaging properties section and verify that Use Shared Runtime is disabled (turning this off allows you to explicitly select which ABIs to support). Click the Advanced button and, under Supported architectures, check the architectures that you want to support:
tip: if you are unaware of arm architectures checking all will remove errors

.Net Standard 2.0 with Realm 3.4.0 'could not resolve reference' Xamarin forms

I have created new Xamarin.Forms project with Android and iOS. After that I installed Realm(3.4.0) in my all 3 projects(PCL, Android and iOS) using nuget. I have also manually added FodyWeavers.xml and I am getting below warning:
could not resolve reference "packages\realm\3.4.0\build..\native\ios\universal\librealm-wrappers.a". if this reference is required by your code, you may get compilation errors.
When I am checking for this file at the specified path, file exists in my system.
For me it's solved by delleting folders bin, obj(Image below) and closing the Visual Studio, after just rebuild it and everithing ok.
Hope it helps.

Asp.NetCore 1.1->2.0 Migration Error - `System.Object' is not defined or imported

I have a project I've been messing with and adding features to, and it was aspnet core 1.1. I am migrating it to 2.0.
I use Visual Studio for Mac, and it's up-to-date.
I am following this documentation:
https://learn.microsoft.com/en-us/aspnet/core/migration/1x-to-2x/
The exact error I'm getting is:
The predefined type `System.Object' is not defined or imported
I found the answer:
In VS for Mac, it didn't let me get to a menu for selecting the target framework for a project. This is usually opened by right-clicking the project, and selecting "properties."
VS for Mac didn't show this.
Upon using my windows install on my iMac, I found the menu and saw AspNetCore2.0 wasn't listed (but 1.0 and 1.1 were). There was also another option to install more. this led me to:
https://www.microsoft.com/net/targeting?utm_source=getdotnetsdk&utm_medium=referral
At this page, there are SDK's for the AspNet Core 2.0 for macOS and windows 64-bit. You need to install these, and then it'll build.
The fact that visual studio doesn't indicate that you're missing a selected framework for the project you're trying to build (as defined in its config file) is absurd. They need to fix this to avoid these kind of headaches. I was under the impression that it wasn't needed, as the NUGET package for 2.0 had all o this.

Xamarin.Forms failed to compile android project with "Droid.Resource.Attribute" does not contain a definition for "actionBarSize"

I have a Xamarin.Forms project, and it worked just fine until I updated my Xamarin Studio Community to latest 5.10.3 (build 51) and updated Xamarin.Forms to 2.2.0.31
When I compile my android project, it showed me
"mynamespace.Droid.Resource.Attribute" does not contain a definition for "actionBarSize"
I did not change anything after upgrade and it works before, I know some others faced the same problem like me when I search on google, seems no one asked this in stackoverflow yet so I would like to get some help here.
If the above doesn't work try this
1) Delete Bin and Obj folders in project folder
2) Delete contents of C:\Users{your username}\AppData\Local\Xamarin\zips
3) Rebuild project
*This will take a while because xamarin will re-download the required files. it should work after its done.
That's a bug listed here. There are different workarounds about this, please try:
Failed to use Android Support Library v4
Creating a Hello World in Visual Studio with Xamarin Forms Fails
Xamarin cross-platform (portable class) project compilation error

cannot build in release only in debug

I have a project built in VS 2013, for some reason I cannot build in release mode only debug mode. If I build in release mode I get a bunch of errors that doesn't really seem relavant. Anyone got any suggestion on where to begin looking for errors?
From your error I can guess that you're using an external library, either through NuGet or locally.
You have to set up the environment to use this library in both release and debug mode. That means installing it on either one through NuGet or setting up the correct include/library paths in the project settings.
In my case it was an unrelated Nuget package that had a higher .Net Framework version than my project.
I had a similar problem, with the same error of Invalid pointer, and it turned out that I had uninstalled Telerik from machine.
1. Make sure that you have Telerik installed , on my machine it is under "C:\Program Files (x86)\Telerik\UI for ASP.NET AJAX Q3 2015\"
The file "Telerik.Web.UI.dll" is available in the Bin[nn]-folders, select the one you want (perhaps the latest version).
2. In visual studio; if your reference to "Telerik.Web.UI" has a yellow warning triangle it indicates that Visual Studio cannot locate the dll file.
Add new reference by browsing your Telerik Bin[nn] folder and selecting the file "Telerik.Web.UI.dll" (and repeat this for all projects using the Telerik components in your solution)

Resources