Xamarin forms Android project TargetFrameworkVersion Error after update to Xamarin Forms 5 - xamarin.forms

I just updated to Xamarin Forms 5 and now I cannot compile my project. I get the error message
The $(TargetFrameworkVersion) (v9.0) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (10.0). You need to increase the $(TargetFrameworkVersion)
However, as you can see from the screen shot below, my Target Framework Version IS 10. What am I missing??

That's actually very easy.
First, go to the Android project and right-click it.
Properties>Application>Compile using Android version(Target version).
Change that to Android 10.0
Then go to the Android Manifest option below the application option.
Change the Target Android version to 10 as well.
This should solve it.
Goodluck
Revert in case of queries

One of my students was using Visual Studio 2019 for Mac and had a similar error.
I shared this link with him. After reading the ideas above, he figured out his solution.
Below is what he told me.
Hi Harlan, thanks! That link helped me find the answer!
FYI: first I downloaded the Android 10.0 SDK.
Then I right clicked on my Android project, went to "General" and
updated "Compile using Android version: (Target Framework)" to Android
10.0 (Q).
Then I went to the AndroidManifest and updated the Target Android
version to 10.0. Then boom, no more build errors! I guess it didn't
like 9.0!
I had been pulling my hair out trying to fix this, thanks again for
the link!

Related

Sdk is missing the Android Support Repository

I'm trying to make a app with Gluon mobile but i'm not able to make the Android version work.
I try to download the SDK directly from android but the SDKManager will not open.
After some research I find that SDKManager is not support anymore.
I install Android studio, but the Support Repository is now obsolete.
Anybody know how I can make it work?
I change my JavaJDK to 1.8 instead of java 11 or 12 but still nothing.
Thanks
Jc
The Gluon Plug-in won't deploy to Android with gradle task androidInstall as the Android SDK is missing "Android Support Repository" which is no longer available with current versions of Android Studio, but the androidInstall gradle task console-log outputs a DOS command-line showing how to download it.
Something like:
C:/Users/.../Android/Sdk/tools/bin/sdkmanager "extras;android;m2repository"
(the above is described in the link mentioned earlier by José Pereda)

Reference to type 'Assembly' claims it is defined in 'System.Runtime', but it could not be found in Xamarin UWP

Already found the same problem here.
My error:
Severity Code Description Project File Line Suppression State
Error CS7069 Reference to type 'Assembly' claims it is defined in 'System.Runtime', but it could not be found
The solution on that thread is downgrade the xamarin forms to version 2.5.1.527436 in all the projects. But I can't do that in my project, because I am using some features that are available in latest xamarin forms like android bottom tab feature, autosize property of editor and flowdirection property of listview.
I have this problem after updating xamarin forms to 3.4.0.1008975 from 2.5.0.121934. Problem is only on the UWP part. Android and IOS apps are working fine.
Error lines:
var rendererAssemblies = new List<Assembly>
{
typeof(ImageCircleRenderer).GetTypeInfo().Assembly
};
rendererAssemblies.AddRange(Rg.Plugins.Popup.Popup.GetExtraAssemblies());
Rg.Plugins.Popup.Popup.Init();
Xamarin.Forms.Forms.Init(e, rendererAssemblies);
So how can I fix this issue without downgrading Xamarin.Forms?
Update
Facing the same problem again for another project. But the solution here is not fixing the error. Changed the target version of windows project to windows 10, version 1809(10.0;Build 17763) and min version to Windows 10 Fall Creators Update(10.0; Build 16299). Screenshot adding below: please suggest a solution.
Xamarin.Forms Version: 3.4.0.1008975
As the linked thread mentions, the problem is that your app has to have min UWP version set to Fall Creators Update (16299), because this is the first release that supports .NET Standard 2.0.
In version 3.0 Xamarin.Forms dropped support for Portable Class Libraries and is now targeting .NET Standard 2.0 only. This means you must target at least Fall Creators Update (16299) in UWP to make sure it can be referenced.
To retarget your UWP project to the newer version, right-click the UWP project node in Solution Explorer, select Properties and then use the two dropdowns to select at least version 16299 in both.
Changing the Min version should be okay as long as you don't need to support Windows 10 Mobile, because absolute majority of users is already on version 1803 and Fall Creators Update is version 1709. See following usage graph (by AdDuplex)

Xamarin.Forms - Xamarin.Forms.Maps broken references in Droid Project

I need to implement Map functionality into an application that I'm building.
And I was folliwing this guide.
I downloaded the package and did all of the configuration.
I haven't implemented the Map class into my project yet, I only did the configuration required for both platforms (Android and iOS).
The Portable project and the iOS project are fine, the problem here is the Android project.
It has some broken references, these ones:
And when I try to compile the Android project, I get this error and these warnings:
Can anybody give me a hand? Thanks in advance.
EDIT:
As a sidenote, I'm using the Sdk installed by Android Studio, and that one has the latest Google Play Services installed.
UPDATE:
I just upgraded the version of my Xamarin.GooglePlayServices one by one (the one listed up there in the first image) for some reason it downloaded a really old version of those. So I just upgraded them, and it seems those references are fine now.
But I still get the error:
The "ResolveLibraryProjectImports" tasks failed unexpectedly.
SOLUTION:
I unloaded the Android project, added this:
<UseShortFileNames>True</UseShortFileNames>
To every property group in the .csproj file.
Load my android project back, and it all worked fine now.

Visual Studio Apache Cordova - IOS build rotation issue

I'm a starter in writing app code in Visual Studio 2013 Community Apache Cordova and have managed to connect VS2013 with my Mac. Once I have gone through the process of building the app in VS and on my Mac and installing in on my iPhone, I open it up and it won't rotate. It doesn't rotate for a number of basic apps that I've written nor does it rotate if I build the default new project "Hello, your application is ready!" app.
I have done some research and tried changing the config.xml "Orientation" preference to "both", through the code window and also in the designer window but that doesn't change anything. I've also noticed that adding in a "BackgroundColor" preference doesn't work either.
Does anyone know if I may have configured something incorrectly or perhaps need to add something to my code?
All the HTML, JS and CSS that I've written seems to work okay (with the exception of trying to link URLs to the Safari Browser but that's another issue).
I have noticed the same issues. I tried finding some settings to fix that in the config.xml, but was not successful. I have resolved myself to just opening the iOS project in XCode and changing a few things:
Device Orientation: no matter the config.xml setting, its always only Portrait. I click-check the other 3 orientations.
Team: I have multiple developer profiles, and I need to choose correct one here.
Bundle Identifier. I screwed up one project, and have different case for iOS and Android. I leave the VS one as the Android one, so I can build completely correct for Android. Since I know I have to go to XCode for iOS anyway, I change the bundle identifier here.
You can find the project using Finder at ~/remote-builds/builds/9999/cordovaApp/platforms/ios/*.xcodeproj, where 9999 is the build number, though not necessarily the latest, largest number, but the latest datetime of the folder.
You can also refer to Greg's answer in this related post as an alternative solution.

Xcode cannot run using the selected device

This is the message while trying to run under XCode 4 (it used to work under XCode 3):
No provisioned iOS devices are available. Connect an iOS device or choose an iOS simulator as the destination.
I have profiles for my device for this app... where should I be looking to correct this?
The problem is that your iOS Deployment Target in Project-> Build Settings is different from the current version of iOS on your real device.
You're asking where to find it:
In XCode 4 there is a new button - look for the big
"Organizer button"
which is at the TOP RIGHT.
Physically connect your device and then click Devices. It seems that the new "Organizer button" is one of the "most-missed" things in the transition to XCode4.
Note, the questioner is asking: "WHERE should I be looking to correct this?"
I was having extra trouble because of my Enterprise License, but still updated the iPads. I didn't have to change anything in the Build Settings to lower. But the main thing that I had a problem with was in the Organizer I needed to hit "Use for Development" button.
Kind of an old post, and may not be the best way or a rookie thing to miss but wanted to help anyone out.
My problem similar to those above were related to having the deployment target set too high for the version installed on the phone. Would be nice if it gave a more useful error message. I spent hours messing with my provisioning profile trying to fix it, when the real problem was the older version of the software on the phone.
I had the same problem. The reason was simply, that my ipad had not been update to version 4.3.
This just happened to me for iOS5 with xcode 4.2.
The answer is to go into organiser, select your device, and press the "Develop with this device" button (or similar wording).
Then go back and build, and it should work..
I received this error while having an iPad properly connected.
Some info:
Ipad iOS version: 4.2.1
XCode 4.2
XCode project created with "iOS Application / Empty Application" template.
The problem was that I had to specify the "iOS Deployment Target" to 4.2 in more than one place!
That is, both in the "Build Settings" and in the "Summary".
Very odd, and definitely another XCode4 annoyance.
I got this error in Organizer - "Could not support development.". I tried rebooting the iOS device and it worked for me :)
Check that the Executable File (also known as CFBundleExecutable) in the Info.plist file is set to ${EXECUTABLE_NAME} as opposed to any hardcoded value. This will ensure that even if you change your project name or target name or scheme name, that it still works.
you need to install the proper version of iOS.in my case it is iOS 4.0 - 4.1 Device Debugging Support
GOTO --> XCode Preferences -> Downloads --> Component
there are all updates available for your iOS click Install.
This is works for me.
It looks like this error can also come about if the "Product Name" in your target's build settings does not match the value of "CFBundleExecutable" in your info.plist
It looks like to me this is the general error Apple gives if the executable is not installed correctly on the device. When the debugger tries to attach it looks for the executable name and if it's not there they give this error. Touch one to debug.
Go to build option and select valid compiler.
Chose your right iOS Deployment version

Resources