Xamarin forms build success but deploy failed - xamarin

I receive this warning when ever I try to deploy my Xamarin.Froms app to any device or emulator. Also the deploy fails without any errors. I cannot run my app. Can Any one please help me?
The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.dll (vv8.0)
is greater than the $(TargetFrameworkVersion) for your project (v7.1).
You need to increase the $(TargetFrameworkVersion) for your
project. App2.Android C:\Users\subas\source\repos\App2\App2\App2.Android\App2.Android.csproj

EDIT/UPDATE
Right now JDK9 and the Android SDK tools are not compatible with each other - thus Xamarin.Android does not work with JDK9.
Run the following to see the version of java you have installed:
java -version
If it reports something along the lines of java version "9.0.4" you have JDK9.
Specifically there's an issue with the apksigner. It's not using the -classpath switch that the JDK expects.
Easiest way to fix is to install the JDK8 and make sure your PATH is pointed at it.
This documentation gives a solid overview.
ORIGINAL
Sounds like the target Android framework in the project needs to be updated to point to the latest version of Android.
First - make sure you have the latest Android SDKs installed. Here's some documentation on that.
Once you have the latest - here is how to make sure you're targeting the latest - depending on the IDE you're using:
Visual Studio Mac
In the solution explorer, right click the Android project and select options.
Under the Build -> General node - select "Use latest installed platform" from the Target Framework dropdown.
Save everything, close the solution, restart VS-Mac
Visual Studio
Right click the Android project in the solution explorer and select properties
Under the Application node, select Use Latest Platform from the Compile Using Android Version dropdown.
Save everything, close the solution, restart Visual Studio

Related

Java SDK 11.0 or above is required when using $(TargetFrameworkVersion) v12.0

While Creating APK At Android API LEvel 31 i Got Above Error.I updated jdk version from 8.0 to 19.0 still got Above error. using -Visual 2019. Don't Know What To Do.Please Provide Some Help.
How Do I Solve This Problem.Please Guide i am not able to publish app on playstore.
To solve this error, first you need to update your Java JDK to version 11.0 or above.
After updating SDK make sure you set the right path under Java JDK location under Visual studio.
Click Tools > Options…
Within the left-hand tree of the Options dialog box, select Xamarin > Android Settings:

Cannot deploy .sln to Hololens 2

What I have done
I looked up a few tutorials and did all their steps. MRTK is successfully installed. I created a simple world in Unity 3D (latest version), with 2 moveable (using the hand interface) objects. In game mode, everything works fine.
Now I wanted to deploy it to my Hololens 2.
So I build the project with the following settings:
After that I connected my Hololense to the PC and want to deploy it via Visual Studio 2022.
It is set to "Release" "ARM 64" "Device".
After pressing on "start without debugging" i will get the following error Codes (as an image because it is better structured):
I already tried installing different SDK packages and creating 5 new Unity projects but it doesnt work. Hope you can help me!
Greetings!
Apart from the suggestions from derHugo, you may also check the following configurations of your project.
Make sure Unity is 2020.3 LTS, and you have used Mixed Reality Feature tools to import/update to the latest package.
Select a specific “Target SDK Version” and “Visual Studio Version” instead of “Latest installed”
In visual studio, make sure the Platform Toolset consists with Unity selection (v143 for vs 2022)
Reinstall “Universal Windows Platform development” component in VS installer and ensure any related to v143 ARM64 build tools are installed (because you are using vs 2022)
LNK1136 error is caused by corrupt or invalid files. Because to deploy a unity project to HoloLens, you need to build a Unity project first. If cleaning VS build then rebuilding is not working, try to remove Unity build then rebuild.
VS installer Screenshot added:

Xamarin - How to update Mono.Android version to resolve dependencies?

I'm trying to install a nuget package (Xamarin.Firebase.Firestore) which requires a newer version of Xamarin.GooglePlayServices.Basement (60.1142.0, I have 42.1021.1), which in turn requires me to update the xamarin.android.support packages. When I try to update those, I get this error
"Package Xamarin.Android.Support.Design 27.0.2 is not compatible with monoandroid80 (MonoAndroid,Version=v8.0). Package Xamarin.Android.Support.Design 27.0.2 supports: monoandroid81 (MonoAndroid,Version=v8.1)"
I've tried changing my target android version to 8.1, I've also updated my SDK as well as the build tools. I'm running Visual Studio 15.6.1. As a last ditch effort, I tried deleting the Mono.Android V8.0 reference and then adding a new reference to V8.1, but whenever I do so, Visual studio just ends up adding the reference with the path pointing to V8.0, even though the reference I added was clearly pointing to V8.1.
Anyone has a clue how to resolve this issue?
tried changing my target android version to 8.1
You need to change the Target Framework that is used to compile your android application, not the Target Android version (but assumably you would set these two to the same, read the Understanding Android API Levels link below.
Visual Studio for Windows:
Visual Studio for Mac:
Target Framework – Specifies which framework to use in building your application. This API level is used at compile time by Xamarin.Android.
Minimum Android Version – Specifies the oldest Android version that you want your app to support. This API level is used at run time by Android.
Target Android Version – Specifies the version of Android that your app is intended to run on. This API level is used at run time by Android.
Understanding Android API Levels
Manifest Entries:
Visual Studio for Windows:
Visual Studio for Mac:

Visual studio for mac not building

When I build my project in debug mode it builds forever. However there is no problem building in release mode.
This problem first occurred when I updated visual studio for mac to the newest version:
Preview 6 (7.0 build 2740).
This is what my debug settings look like:
Any ideas are much appreciated.
Check for xamarin.forms updates in both in the ios and xamarin project. It could be that theese are not updated even though the solution is updated.
Xamarin.forms package under the iOS project might have an older version
I cannot really help you because I don't know what type of project you tried to run or which OS X you are working with.
If such an Error occurs, always check your code or try restarting your mac.
Tip: "Visual Studio for Mac Preview" is still in its Alpha. Use the Stable Update channel to avoid errors like this.

Problems building Xamarin.iOS project with Visual Studio using Xamarin 3. Error 11 The maximum deployment target for iOS is 9.1

We use Xamarin on Windows with Visual Studio to build our app for iOS.
We recently upgraded to Xamarin 4 and found we were not able to build.
Various errors including builds hanging, Linked Away exceptions.
After some effort we decided to revert to Xamarin 3 using the links on this page
https://store.xamarin.com/account/my/subscription/downloads#xamarin3
Where it says "Looking for the version before Xamarin 4? Get the latest stable version of Xamarin 3".
We now cannot build and get the following error:
**Error 178 The maximum deployment target for iOS is 9.1 (current deployment target is 9.2).
Please select an older deployment target in your project's Info.plist.**
In Visual Studio, this setting is selected in the project settings and the only value available is 9.2. If I try and update in the .csproj file xml, it gets overwritten.
I have had a look at all the various versions of Xamarin for Visual Studio and for the Mac (in the show all versions on the above page) and cannot find versions that will allow us to build. i.e. versions with the old build client with matching Xamarin.iOS versions.
Are there matching Xamarin.iOS releases still available for both Mac and windows that use Xamarin 3?
Is there a way I am missing of forcing the SDK value to match the build server?
For what it's worth the answer was in the error message (kind of).
The necessary update to Info.plist was adding the following:
<key>MinimumOSVersion</key>
<string>9.1</string>
This was only apparent after I had noticed that there was an editor called PListEditoryFactory, which gives a ui to edit Info.plist.
The file didn't open in PListEditoryFactory by default, so it just looked like an xml file to me.
In the ui the field needed editing is called 'Deployment Target', needs to be 9.1.
Another curveball was that the error message says that the 'current deployment target ' is 9.2, which was the value selected (and only option) in the iOS project settings TargetSDK dropdown.
What this is for and how it is different to the Info.plist setting I dont know.

Resources