Xamarin.Android.Support.v7.AppCompat 25.1.1' is not compatible with 'Xamarin.Forms 2.3.3.193

I ran into a problem while using Visual Studio with Xamarin. My intent is to deploy the .Droid project of a Xamarin Portable Class Library solution to my Samsung Galaxy S4 running 5.0.1 Lollipop (API 21).

However, I am getting the exact same error as the person in this thread experiences, which seems - apparently - to be related to an outdated(?) toolbar.

stackoverflow.com/questions/39829691/android-views-inflateexception-binary-xml-file-line-1-error-inflating-class

I tried to run the solution he subsequently posted and recommended but was unable to add the necessary nuget packages (see screen shot below).

I then tried to follow the instructions in this link...

https://nuget.org/packages/Xamarin.Android.Support.v7.AppCompat/

...just to end up with the following Package Manager Console error output (see new screen shot).

I am pretty sure, that this somehow has to do with the toolbar. Could this be an issue with the design having evolved into a different direction or some control being deprecated in the newer versions of Xamarin?

Since I unfortunately do not have access to another Android device, I'll have to get this working on the present one. Any help would be highly appreciated.

Thanks a lot in advance.

Answers

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭
    edited February 2017

    You should never try to update the Xamarin.Android.Support.xx nugets. Ever.
    If you look at the Xamarin.Forms package you will see the dependency is
    = 23.3.0
    NOT
    => 23.3.0

    https://redpillxamarin.com/2016/12/23/202-starting-on-the-right-foot-2/

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent First of all, thanks for your swift reply. Secondly, I read the link you posted from top to bottom but I am nowhere closer to understanding how this can help me in solving my problem with the Android device.

    I guess that you are referring to topic #3. in which there is talk of never updating the Xamarin.Android.Support.xxx packages. So I am taking it from your post that updates should only be done via the "Manage NuGet Packages for Solution" in the Visual Studio menu. However, the first screen shot I posted displays just that NuGet Manager (not the terminal but the regular NuGet update manager).

    If you take a closer look in the top menu it says "Updates 7" indicating the need for updates to seven Xamarin packages (correct me if I am wrong here). Now when trying to update, I am unable to do so. Instead the load just stops and the updates do not execute.

    The idea for getting those updates and the suspicion in relation to the device error was basically rooted in my conviction that the updated packages (in particular Xamarin.Android.Support.v7.AppCompat) would correct that erroneous behavior.

    Thus I cannot see how this can help me.

    Can you elaborate or rephrase, please?

    Thank you.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @Anders_A said:
    If you take a closer look in the top menu it says "Updates 7" indicating the need for updates to seven Xamarin packages (correct me if I am wrong here).

    You are wrong here. As said in that article: Do not update those packages. I'm not sure this could have been much more clear than to say when Visual Studio tells you there are updates it lies, in bold and bright red warning text.

    So I am taking it from your post that updates should only be done via the "Manage NuGet Packages for Solution" in the Visual Studio menu.

    Where did you get that from? It says "Don't do it. Ever" - there is nothing about doing it from a special place or in a special way. "Never ever" is pretty explicit.

    To be clear - I don't mean for my post to imply any emotional content. I'm just trying to stress and emphasize what seems to have been stressed on the link, but was somehow overlooked or misinterpreted.

    At the risk of beating this dead horse I will try to rephrase it for clarity.

    You cannot update to support packages higher than 23.3.0 in any way, shape, form, technique or with some other tool, packager, console, command line or installer.

  • Anders_AAnders_A USMember ✭✭

    Okay..., there has just been a new development. Luckily to the better.

    When I was fooling around with the NuGet update manager and had a look at the screen shot that you posted earlier, I realized that when you mark an item in the update list, it is possible to also update that item by using the buttons in the item's "Properties" pane, appearing on the right. After marking the Xamarin.Forms item and hitting the update button, that item and only that one (oddly) could be executed. I hereafter restarted VS and tried to deploy again to the Android device. This time though..., it DID deploy! The odd part is that the NuGet update manager now instead of seven lists "Updates 8" with the Xamarin.Forms item missing in that update list (since it has been obviously updated during the last execution) and none of those remaining eight updates can be executed in any way. So in essence, the only thing needed was apparently the update for that one item, indicating that - as your link also explains - the update cycle has been messed up with the version digits being changed, all while the updates are still correctly recognized by the NuGet update manager. In other words "false positives" are displayed in that list.

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent I just wanted to turn back here (have been sick with the flu for the past few days) to say thank you for your input and the time you took to help me out with my problem. Was highly appreciated! ;)

    Thank you!

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    No worries mate, but much appreciated. Its called a coding community because like any community we all help each other. I get a lot of good answers, suggests and support here and try to give back what I can in return.

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent Sounds good to me. B) I was having the opposite response and attitude lately on SO which seems to be in serious decline, so I am happy about having found this forum. I plan on coming back here on a regular basis from now on and in the near future. ;) Not yet there where I feel, that I can give back much to others but have been doing a bit of just that when achieving great results of my own during my last project about "Big Data". So if you need help and advice with Azure..., I'm your man. :)

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    To be fair and point out my goof up. I responded to your post out of habit from people trying to update support packaged on Xamarin forms .180 - as shown in the screen capture I posted. I totally missed that the title of your post was for Forms .193 - which is cycle 9 - which is supposed to support upgrading those support packages.

    In another thread someone asked a related question and got no response.
    https://forums.xamarin.com/discussion/89612/referencing-android-libraries-impact-on-device-compatibility#latest

    Basically I don't know anyone that's tried doing the update or discovered how it would really impact their work.
    I guess I'll make a new basic solution and give it a whack and see what happens.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Well, looks like it works

    I updated Xamarin.Forms to 2.3.3.193
    Then updated all the Xamarin.Android.Support.xxx packages.
    First build errored.

    Clean solution
    Close solution
    Open solution (so Visual Studio goes through its Loading... process)
    Build PCL project
    Build Droid project
    Run on my Samsung S6 (Droid 5.1.1 OS)
    And darned if it didn't work just fine.

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent That's weird. I just now tried to install all of the eight updates again that are available with my present Xamarin Forms .193 version and not one of them - just like last time - can be updated the way, you just were able to update with that exact same version. However, my build on my SG 4 and the iPhone 5 works now perfectly and displays the same exact UI and formatting (colors, location etc.) So it's not a problem with deployment anymore, just that those eight items cannot be updated. Maybe, it's still messing up due to the changed version numbers by Xamarin? But then I don't see how it should work on your machine and not on mine.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @Anders_A
    When you updated - did you update the java prerequisites etc. before updating Xamarin forms?
    https://forums.xamarin.com/discussion/89363/before-updating-to-cycle-9/p1?new=1

  • Anders_AAnders_A USMember ✭✭

    At the present, my Xamarin SDK, JDK etc. settings look like this...

    When I started with this machine from scratch, it came installed with the second last Java SE Devlopment kit which I think was version 7 vs. version 8 that I got installed now. I had this machine prepared by IT-support in my company (general safety procedures here) and thus no influence on that part. However, I remember an error report in VS about 2 weeks ago, that - after searching the net - prompted me to uninstall version 7 and install version 8 instead. After that, the error disappeared which I am pretty certain, was related to the .Droid project in my solution. I think that error back then kept VS from deploying to the Android device. When we started discussing my errors in this thread, version 8 was already installed long ago but I don't know if this could still somehow have relation to the update issues. My solution is PCL by the way if that should matter. Also, I noticed that when I compare the already installed versions to the ones present in the update pane, they all list the same versions v25.1.1 which seems to point furthermore to an issue with the change in version numbers by Xamarin.

    Screen shot of "Installed" items here...

    Screen shot of "Updates" items here...

    As mentioned before however, I now do not have any problems with deploying to both my devices whatsover, so I can easily live with that issue for now.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    the already installed versions to the ones present in the update pane, they all list the same versions v25.1.1

    No. 25.1.1 is not installed. Notice the blue up arrow on each of those. Its telling you that upgrades TO 25.1.1 are available. Versus the green check on the Xamarin.Forms package letting you know it is up to date.

    Single click on of the packages then look in the right hand pane. You'll see you have a lower version installed and the higher version available to install.

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent Well, you are right. It does show an older installed version and a newer "Latest stable 25.1.1." in the right hand pane.

    But no matter what I do, I still am unable to update to that newer version as mentioned last time. I only get an error message of "being incompatible" with Xamarin.Forms as during all the latest update attempts.

    Beats me as to why... :o

  • AndrewzAndrewz USMember ✭✭

    @ClintStLaurent While build works after cleaning solution and reopening it, aren't you getting yellow warnings on the references in the project tree?

    https://forums.xamarin.com/discussion/comment/251742/#Comment_251742

  • Anders_AAnders_A USMember ✭✭

    @Andrewz I just saw your post, got curious and checked my references and I got that same issue, just with one single reference under the Android project --> System.ObjectModel.

    See screen shot...

    I noticed, that - although we got the same warning - your references seem to have a path to a corresponding file. The System.ObjectModel in my project doesn't, whereas the all the other references in my project do have correct paths.

    So, I am wondering if this has something to do with the warning and if it is possible to edit the path property and thus fix the issue. Provided - of course - that that file/reference exists in the correct folder.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    I do get the warning icons due to missing path.
    But I'm so used to Visual Studio doing stupid stuff that 90% of the time I really only care if the solution builds and deploys.

    My little test here was just to see if the update to 25.1.1 worked, crashed a basic app etc. It does work, the app builds and deploys. :D Intellectual curiosities such as this that don't break functionality of my code, don't push to the top of my mental stack until I have free time; after work, after personal projects, after family time, after forest care on my property, after washing my truck, after working on my costume for ComicCon. B)

  • AndrewzAndrewz USMember ✭✭
    edited March 2017

    @Anders_A those warnings appear after adding a Xamarin Google Play Services component, Location for example (see the link I posted) or after updating the Xamarin Android Support libraries, which is what @ClintStLaurent did above.

    As for the System.ObjectModel, I think you can remove it.

    @ClintStLaurent I'm actually not used to ignore warnings on references. I wish someone cleared this issue with some good explanation..

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    @andrewz @Anders_A

    I wish someone cleared this issue with some good explanation..

    I wish that too. But I also wish the Bugzilla backlog would be cleared... that we had multibinding like in WPF... That we had merged dictionaries... that we had bindable UI presentor like `ListBox`` that could do more than just a vertical list of cells... that the cost of 5.56 ammo would drop, and 100 other things.

    I stopped wishing for a lot of thing beyond my control a long time ago. I build code, work within the actual reality of life and stopped screaming in to the wind a long time ago. Now and then I rage against things like Bugzilla tickets going months without movement. But mostly I try to work the issues I can actually affect: Like work and home.

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    DO NOT UPDATE TO VS2017RC

    Can't make a new Xamarin solution. Can't select solution type (PCL/Shared). Solution templates are hosed (per every time)
    https://forums.xamarin.com/discussion/89979/do-not-update-vs2017rc/p1?new=1

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent Wow, thanks for that warning! I am so not in need of additional problems in regards to the project, I am currently working on. Appears as if the need for VM testing is required with each update being rolled out on VS.

  • Anders_AAnders_A USMember ✭✭

    @Anders_A those warnings appear after adding a Xamarin Google Play Services component, Location for example (see the link I posted) or after updating the Xamarin Android Support libraries, which is what @ClintStLaurent did above.

    As for the System.ObjectModel, I think you can remove it.

    If you don't mind me asking a bit naive..., how come it can be removed and what function/importance in relation to the Xamarin framework does that reference hold?

  • PeterFarrerPeterFarrer USMember ✭✭

    @ClintStLaurent said:
    You should never try to update the Xamarin.Android.Support.xx nugets. Ever.
    If you look at the Xamarin.Forms package you will see the dependency is
    = 23.3.0
    NOT
    => 23.3.0

    https://redpillxamarin.com/2016/12/23/202-starting-on-the-right-foot-2/

    Thanks Clint for the perfect answer, I am using 24.2.1 and this seems ok, I now know to regress if needed.

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent I just tried to run those updates again that I could not previously install and surprise, surprise..., take a look at this... :)

    As you can see, all installed nice and neat and no updates left in the updates tab. However, after trying to build to device I ran into a "gazillion" of errors and was in the beginning unable to deploy to Android (without any issues deploying to iOS though at any point). I then recalled your earlier advice to clean and rebuild and hereafter could slowly but gradually remove all those errors and was able to build on both iOS and Android with success. The only issues now left are these...

    I reckon, there is no need to worry about that though as I remember you having the same issues while still being able to do builds. So, I'll leave it for now... ;)

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    Sounds like good news. Yeah, I actually just turn off 'warnings' - bad practice probably. But I like getting assignments done first, then maybe chase things like that down at the end of the month of there is time to spare.

  • Anders_AAnders_A USMember ✭✭

    @ClintStLaurent I hear ya. ;) If you stumble upon a solution for this, give me a shout-out. You can find me by looking for the sunglasses while I'm busy basking in the limelight of my success. B)

  • _Jai_Jai USMember ✭✭

    @ClintStLaurent I have updated xamarin forms its not updating support lib, can you tell me that what is mono version in that? i need to install geolocator plugin

  • ClintStLaurentClintStLaurent USUniversity ✭✭✭✭✭

    i need to install geolocator plugin

    You should be able to select that plugin and install it. It should install any dependencies automatically.

  • dhananjeyankdhananjeyank Member ✭✭
    edited October 3

    **
    Android version DownlaodManger 6.0 working and above android version 7,8,9 downloadmanger not working ..help**
    using package xam .plugin .downloadmanger


    await Task.Run(async () =>
    {

                var downloadManager = CrossDownloadManager.Current;
                var file = downloadManager.CreateDownloadFile(Url);
    
                                downloadManager.Start(file);
                bool isDownloading = true;
                while (isDownloading)
                {
                    await Task.Delay(10 * 1000);
                    isDownloading = IsDownloading(file);
                }
                if (!isDownloading)
                {
                   // await Application.Current.MainPage.DisplayAlert("Message", "Downloaded", "ok");
    
                }
    
    
            });
        }
    
Sign In or Register to comment.