Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Cannot upgrade to XF 5.0.0.1874 Failed linking resource file textend is incompatible with attribute gravity #13303

Closed
developer9969 opened this issue Jan 6, 2021 · 78 comments
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects

Comments

@developer9969
Copy link

developer9969 commented Jan 6, 2021

Hi
Excited to upgrade to XF 5 stable but as soon as I compile my solution my android project fails with 2 errors

Error 1 (probably linked to error 2)
Severity Code Description Project File Line Suppression State
Error failed linking file resources.

Error 2
verity Code Description Project File Line Suppression State
Error 'textEnd' is incompatible with attribute iconGravity (attr) flags [start=1, textStart=2] [weak].
MyCompany.Mobile.droid D:\Work\MyCompany.Mobile.droid\obj\Debug\100\lp\136\jl\res\layout\mtrl_calendar_month_navigation.xml 33

the problem is that this code is autogenerated so there is nothing I can do

I also tried to add a nuget Xamarin.Google.Android.Material to see if it solves the problem but doesnt.

Reverted to 4.8.0.1560 and all good again, Hopefully someone can look at it or advise a workaround.

Thanks!

`
<!--

            Copyright (C) 2019 The Android Open Source Project

	 Licensed under the Apache License, Version 2.0 (the "License");
	 you may not use this file except in compliance with the License.
	 You may obtain a copy of the License at

		  http://www.apache.org/licenses/LICENSE-2.0

	 Unless required by applicable law or agreed to in writing, software
	 distributed under the License is distributed on an "AS IS" BASIS,
	 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	 See the License for the specific language governing permissions and
	 limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  android:id="@+id/month_navigation_bar"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:paddingTop="@dimen/mtrl_calendar_navigation_top_padding"
  android:paddingBottom="@dimen/mtrl_calendar_navigation_bottom_padding"
  android:orientation="horizontal">

  <FrameLayout
	android:layout_width="0dp"
	android:layout_height="match_parent"
	android:layout_weight="1">

	<com.google.android.material.button.MaterialButton
	  android:id="@+id/month_navigation_fragment_toggle"
	  android:layout_width="wrap_content"
	  android:layout_height="@dimen/mtrl_calendar_navigation_height"
	  android:layout_gravity="start"
	  android:gravity="center_vertical|start"
	  android:insetBottom="0dp"
	  android:insetTop="0dp"
	  app:icon="@drawable/material_ic_menu_arrow_down_black_24dp"
	  app:iconGravity="textEnd"
	  app:iconPadding="4dp"/>

  </FrameLayout>

  <com.google.android.material.button.MaterialButton
	android:id="@+id/month_navigation_previous"
	android:layout_width="@dimen/mtrl_min_touch_target_size"
	android:layout_height="@dimen/mtrl_calendar_navigation_height"
	android:contentDescription="@string/mtrl_picker_a11y_prev_month"
	android:gravity="center"
	android:insetBottom="0dp"
	android:insetTop="0dp"
	app:icon="@drawable/material_ic_keyboard_arrow_left_black_24dp"/>

  <com.google.android.material.button.MaterialButton
	android:id="@+id/month_navigation_next"
	android:layout_width="@dimen/mtrl_min_touch_target_size"
	android:layout_height="@dimen/mtrl_calendar_navigation_height"
	android:contentDescription="@string/mtrl_picker_a11y_next_month"
	android:gravity="center"
	android:insetBottom="0dp"
	android:insetTop="0dp"
	app:icon="@drawable/material_ic_keyboard_arrow_right_black_24dp"/>

</LinearLayout>

`
Reproduction

  1. Build solution
  2. See error
  3. WE CANNOT UPGRADE TO 5 and is holding back 5 clients.
    SampleXF5.zip
@developer9969 developer9969 added s/unverified New report that has yet to be verified t/bug 🐛 labels Jan 6, 2021
@samhouts samhouts added this to New in Triage Jan 6, 2021
@hartez
Copy link
Contributor

hartez commented Jan 6, 2021

@PureWeen:
Looks like this might be an issue others are also having after updating to more recent Material versions: https://stackoverflow.com/questions/63168050/android-resource-linking-failed-android-studio

@hartez
Copy link
Contributor

hartez commented Jan 6, 2021

@developer9969 Where does this generated XML come from?

@hartez hartez added the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Jan 6, 2021
@hartez hartez moved this from New to Needs Info in Triage Jan 6, 2021
@PureWeen
Copy link
Contributor

PureWeen commented Jan 6, 2021

@developer9969

  • Can you attach a repro?
  • Can you verify that all your projects are on the same version of XF? And that Material is on the same version of XF?
  • Do you have any androidx nugets added explicitly? For example the Google.Material? If so, can you remove them
  • Can you try deleting the obj/bin and rerunning to see if that fixes?

@developer9969
Copy link
Author

developer9969 commented Jan 7, 2021

@hartez @PureWeen
thanks for your replies I have tried to create a repo but cannot replicate in a noddy sample.
That code I guess is generated by android somehow...

I had a mixture of Android.Support libraries and AndroidX but I did not have any nuget package that uses material.
and the error did not give any clue

image

However I have fixed the issue by running the AndroidX Migrator and noticed that it replaced all the support with AndroidX equivalent but more importantly I think the one that made the difference was as below.

Xamarin.Android.Support.Design
with
Xamarin.Google.Android.Material and now the solution compiles,

in fact because it removed support.Design the code below now uses uses Xamarin.Google.Android.Material
e.g BottomNavigationView. instead of support library.

` public class TabbedPageNoShiftEffect : PlatformEffect
    {
        protected override void OnAttached()
        {
            if (!(Container.GetChildAt(0) is ViewGroup layout))
                return;

            if (!(layout.GetChildAt(1) is BottomNavigationView bottomNavigationView))
                return;

            // This is what we set to adjust if the shifting happens
            bottomNavigationView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityLabeled;
        }

        protected override void OnDetached()
        {
        }
    }`

In conclusion obviously something has drastically changed in 5 and the error given was not helpful but your mentioning of androidX made me try the migrator which fixed the issue and highlight the problem.

It compiles now I have to check if things still work :)

thanks for replying

@PureWeen
Copy link
Contributor

PureWeen commented Jan 7, 2021

@mattleibow ? Any thoughts?

@developer9969
Copy link
Author

developer9969 commented Jan 10, 2021

@PureWeen @mattleibow @hartez
Hi there , apologies for being vague but I am struggling to build a repo to show our problem, I cannot post our client project , upgrading to XF5 is failing android projects where you have a mixture of AndroidSupport Library and AndroidX library.

As soon as upgraded to 5 the solution not longer builds and I get "failed linking file resources" see pic above in the thread that is just an android library that we use , to fix it I had

  1. to remove the dependency from
    <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" /> and replace with
    <PackageReference Include="Xamarin.Google.Android.Material">
      <Version>1.2.1.1</Version>
    </PackageReference>
  1. Change the reference for BottomNavigationView and Snackbar to use amarin.Google.Android.Material

However the main solution we get
image

\obj\Debug\100\lp\138\jl\res\xml\standalone_badge_offset.xml(19): error APT2259: '10dp' is incompatible with attribute horizontalOffset (attr) float [weak].
\obj\Debug\100\lp\138\jl\res\xml\standalone_badge_offset.xml(19): error APT2259: '5dp' is incompatible with attribute verticalOffset (attr) float [weak].
C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Aapt2.targets(164,3): error APT2061: failed linking file resources.

No sure where the above is coming from... some linking attribute is going wrong.

Workaround
Use 4.8.0.1560 and all works without doing anything

Has something changed in regards to using Xamarin.Android.Support.Design and AndroidX? Can both live together? unfortunately till some of the nuget we use dont update we are stuck with both!!!

Does the above give enough to go on?

many thanks

@lu-nguyen-khoa
Copy link

image
Same problem when update XF 4.8 to 5.0 lastest.

@lu-nguyen-khoa
Copy link

After Clean Solution and Rerun. It work fine..

@developer9969
Copy link
Author

@haiduong741 hi there, I deleted bin/obj too but does not go away for me . we are STUCK now, just hope it gets prioritized
do you have a small repo to replicate the issue . It might get fixed earlier.
thanks

@lu-nguyen-khoa
Copy link

It only run OK one time. Error still appear again. I have tried a repo but it run ok with XF 5.0. Only my company's project error...

@developer9969
Copy link
Author

@PureWeen @hartez @mattleibow I have attached a small repo (see intial post) just build the solution and you should see the error. this is stopping us upgrading, Is this something for the Android Team? Hopefully you will get the time to look into this one. Many thanks

@dphamsafetrust
Copy link

You can try on 5.0.0.1791-pre5 version, it solved this my issue but 5.0.0.1874 still got problem.

@developer9969
Copy link
Author

@dphamsafetrust hi interesting but that is an old version not a new one.Do you have same issue as I do?

@dphamsafetrust
Copy link

@dphamsafetrust hi interesting but that is an old version not a new one.Do you have same issue as I do?

Exactly same :)

@developer9969
Copy link
Author

@dphamsafetrust problem is it does not seems to be in the list of items they are working on for 5.01 and we will never be able to upgrade until is fixed or someone suggests a workaround.

@lu-nguyen-khoa
Copy link

Pls answer or attach a solution for this. @hartez
Thanks.

@gabsterdev1
Copy link

@developer9969 hi there we have exactly the same issue .Any news or workaround?

@PureWeen @hartez any suggestions?

many thanks

@BYES-PA
Copy link

BYES-PA commented Jan 15, 2021

This happens with my project as well

@developer9969
Copy link
Author

Hi there we love xamarin and we would like to upgrade to the latest , we totally get it that you are very busy as there many bugs raised daily but I think the inability to upgrade to the latest code is quite important. Could someone from the Xamarin team reply to this thread?

@PureWeen
Copy link
Contributor

@developer9969 sorry if I've missed some steps but what do I do with your sample to reproduce? I downloaded it and it's running fine for me. I also removed all of the support and androidx packages and it still ran fine for me.

@haiduong741 @gabsterdev1 @BYES-PA do you have repros?

@PureWeen
Copy link
Contributor

If you disable aapt2 in the project properties does that fix the issue for you?

image

@PureWeen
Copy link
Contributor

PureWeen commented Jan 15, 2021

@haiduong741 @gabsterdev1 @BYES-PA @developer9969 @dphamsafetrust

  • Can you make sure all your projects have the same Xamarin.Forms installed?
  • I would uninstall any support/androidx libraries you have installed and just let them transitively come from forms
  • Can you try rebuilding the project?
  • If rebuilding doesn't work can you close out of VS. Delete the bin/obj directories. Re-open the project and then try and compile again?
  • make sure you're on the latest version of VS (16.8.4)
  • Make sure all your Android SDKS are up to date (Tools => Android => Android SDK Manager)

image

If that still doesn't work can you install this tool here to create a binlog of your build and then attach that here?
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools

@lu-nguyen-khoa
Copy link

If you disable aapt2 in the project properties does that fix the issue for you?

image

My Company's project:
image

@lu-nguyen-khoa
Copy link

Enable aap2:
image

@lu-nguyen-khoa
Copy link

lu-nguyen-khoa commented Jan 16, 2021

My project has been installed lastest:
image

@LanceMcCarthy
Copy link

LanceMcCarthy commented Jan 25, 2021

@haiduong741 There are multiple problems there.

The first problem is you have a reference for a 25.4.0.2 v7 support library, you also have references for v7 28.0.0.3. Those all need to be the same 28.0.0.3 version. However, that is not your fundamental problem.

Bottom Line

The bottom line is anything that starts with Xamarin.Android.Support.xxx cannot be used with Xamarin.Forms 5 or later. You want to set your target SDK to Android 10 (or later) and all your dependencies to use AndroidX libraries.

To further clarify this, here is a screenshot of the Xamarin.Forms 5.+ dependencies:
image

Path Forward - Migrating to Xamarin.Forms 5.0

You need to do a couple things, Microsoft has explained them in the following articles:

To get a little headstart, you can use the automatic migrator tool:

Enable the feature:
image

Then run it on the Android project
image

I recommend what @developer9969 did. Start clean and slowly add in the dependencies you need. Only do this after you followed the guidance in the two documentation articles.

Further Assistance

The problem you are having is unrelated to the topic in this GitHub Issue. So that we don't continue to add off-topic content to the original problem here, please open a new issue on Microsoft Q & A instead of replying here.

https://docs.microsoft.com/en-us/answers/topics/dotnet-xamarinforms.html

Ping me on Twitter after you create the post, I will continue to assist you on Microsoft Q&A https://twitter.com/lancewmccarthy

@LanceMcCarthy
Copy link

@PureWeen We have identified the problem, it is a conflict of object types in the Xamarin.Google.Android.Material package against external definitions.

As a quick public example, imagin you defined the following in the native Android project's attrs.xml (notice format is set to float):

<declare-styleable name="MyCustomAnnotation">
     <attr name="horizontalOffset" format="float" />
     <attr name="verticalOffset" format="float" />
 </declare-styleable>

However, take a look at one of the attributes being used in the lastest version of Xamarin.Google.Android.Material (notice the 5dp and 10dp string values):

<badge xmlns:app="http://schemas.android.com/apk/res-auto"
    app:maxCharacterCount="2"
    app:horizontalOffset="10dp"
    app:verticalOffset="5dp"/>

this is what we believe is breaking the build in Telerik UI for Xamarin's case. I am going to email you directly so I can share portions of our private code and introduce you to one of the devs on the team.

As far as @developer9969 original problem, I suspect there is also a similar problem with app:iconGravity="textEnd"

Thanks!

@developer9969
Copy link
Author

@LanceMcCarthy Excellent explanation, however I did not know that

The bottom line is anything that starts with Xamarin.Android.Support.xxx cannot be used with Xamarin.Forms 5 or later. You must set your target SDK to Android 10 (or later) and all your dependencies need to be AndroidX libraries.

I have some apps that have a mix of support and Androidx set with a target of Android10 and they compile and I dont have any errors. My understanding is that at build time it will Swap them to AndroidX and dont have to be all AndroidX. (Of course we want to use AndroidX)

Below is an extract from the doc you referenced.
image

Am I missing the obvious?

Just read you recent finding. FINALLY . Thanks

@LanceMcCarthy
Copy link

My understanding is that at build time it will Swap them to AndroidX and dont have to be all AndroidX. (Of course we want to use AndroidX)

Am I missing the obvious?

You are correct, the bindings should get compiled for AndroidX, but that is assuming the process does a perfect discovery and match. This is mostly to help the transition for projects using libraries that haven't been updated with AndroidX dependencies yet (the transistive part of the puzzle).

In the case of Lunk's project, since he's already going to be fixing a bunch PackageReferences list, might as well keep things as clean/simple as possible and put in the AndroidX packages now. Especially when you can just let the XF 5.0 package by itself (and let the nuspec dependencies list do the heavy lifting).

@developer9969
Copy link
Author

thanks you for your time in answering . I spent at least 3 full working days on this issue. Very very frustrating.
Next task is to remove those support library where I can, some third party vendors have not upgraded. We use one for notifications and they wont move to androidX.

Again, brilliant explanation

@lu-nguyen-khoa
Copy link

lu-nguyen-khoa commented Jan 26, 2021

I has been fixed problem after update XF 5.0.1931 and remove v7 reference.
Thanks for your solution @LanceMcCarthy
Thanks for your support @developer9969
Thanks you..

@LanceMcCarthy
Copy link

I have some good news and bad news.

  • The good news is we know what is causing the problem and there is a permanent solution available
  • The bad news is that the fix needs to be done by the library authors.

Problem Explanation

The fundamental issue is if there are two attributes with the same name, but use different value types, the Android compiler will throw an error. This not an issue with the Xamarin, but the native Android side of things.

As a simplified example, let's say you have (or are using) a library that has a custom attribute named "MyThing" and it is a numeric type (i.e. float). Then, lets say Google's Material library comes along at a later time and adds its own "MyThing" attribute... However, this attribute is of type string.

Here's what I just explained in Table to make it more clear

Library Attribute Name Attribute Type
Custom Library MyThing float
Google Material MyThing string

The compiler is going to come along and see that any values set to the Google Material's MyThing value is not a float. So, you would get an error that looks like:

Error 'MyThingStringValue' is incompatible with attribute MyThing (attr) float [weak]

Solutions

The options I am currently aware of (there may be more, I am not an expert in aapt2):

  1. Downgrade from the Google Material version that contains the conflict
  2. The custom library author can rename their custom attributes (this is how Telerik is planning to resolve it)

I hope this helps!

Note: @developer9969 Whomever owns the library that contains the gravity attribute needs to be notified of this, they can rename the custom attributes, which should prevent future issues.

@developer9969
Copy link
Author

@LanceMcCarthy hi there the clashing I was having was nothing todo with a third party library but with
<PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" /> removing this library and replacing with Xamarin.Google.Material ,
Fixed below error.
the Error 'textEnd' is incompatible with attribute iconGravity (attr) flags [start=1, textStart=2] [weak].

then I had other errors that were solved by cleaning up no longer used Android.Support.Library

@nziosys
Copy link

nziosys commented Feb 15, 2021

@LanceMcCarthy I'm facing the issue even just scaffold an XF project and just update XF and essentials. As soon as I add telerik ui for xamarin it can't build because of the mentioned error of '5dp.. verticalOffset' and so on.
Any suggestions or planed release fixing it?

<ItemGroup> <PackageReference Include="Telerik.UI.for.Xamarin"> <Version>2021.1.119.1</Version> </PackageReference> <PackageReference Include="Xamarin.Forms" Version="5.0.0.2012" /> <PackageReference Include="Xamarin.Essentials" Version="1.6.1" /> </ItemGroup>

UPDATE:
Just saw the XF 5.0.0.2012 adds Xamarin.Google.Android.Material 1.2.. which causes the problem.
But is it something that will be fixed on your side, or do we need to hope material package do it?

@LanceMcCarthy
Copy link

@nziosys That looks like the class library project's packages. The problem is in the Android project's packages.

Please check the Android project's .csproj and review it against my working version above.

@nziosys
Copy link

nziosys commented Feb 15, 2021

@LanceMcCarthy Thanks for the realy fast answer!
I need to update to the last releases of forms and material, as they fix bugs. rolling back to the mentioned versions in you .csproject don't solve those bugs.
Any plans to fix it on your side?

@LanceMcCarthy
Copy link

UPDATE:
Just saw the XF 5.0.0.2012 adds Xamarin.Google.Android.Material 1.2.. which causes the problem.
But is it something that will be fixed on your side, or do we need to hope material package do it?

We have a permanent fix coming out in the next release (within a week or two). In the meantime, the lib that causes the conflict is the Chart. IF you're not using the chart, then use other sub-packages instead (i.e. Telerik.UI.for.Xamarin.DataControls)

@dynamisoft
Copy link

dynamisoft commented Feb 16, 2021

Hi all,
this same exact error happened to me over Christmas vacation but there were no posts anywhere. After days of trying and ripping hair out, i ended up downgrading everything. As i was reading through your posts above, i did all the same steps you tried above. Thank you for the fix, I was able to remove all references in the Telerik library except what was needed. Not only does the chart cause the problem, but this one causes the issue as well : Telerik.UI.for.Xamarin. Take this out and use Telerik.UI.for.Xamarin.Common if you are using a generic control and it will fix it. I was only using the splitter, which is in Common. I am now fully XF 5+ and AndroidX. I am also a user of Syncfusion. Thanks for the fix!

@LanceMcCarthy
Copy link

but this one causes the issue as well : Telerik.UI.for.Xamarin.

To help prevent any confusion, let me take a moment to explain the package names:

The Telerik.UI.for.Xamarin contains everything. All the controls, all the document processing libraries, everything. The intent is that you only need to install that one package into every project and you're done.

However, until we release the next version with the fix for Chart, you will need to only use the packages for the controls you need.

For example, if you are using RadListView, you would install Telerik.UI.for.Xamarin.DataControls. Thanks to NuGet's automatic dependency resolution, it will also install the other dependent packages like Common and Primitives.

@LanceMcCarthy
Copy link

FYI - We have released a new internal build of Telerik.UI.for.Xamarin that contains the fix. Install 2021.1216.1-hotfix to all the projects in the solution.

  1. Open NuGet Package Manager for Solution
  2. Select the Telerik package source (or select "All")
  3. Check the "Include Prerelease" checkbox

If you already have Telerik.UI.forXamarin installed, the hotfix will appear as an available update. If you are starting fresh, search for the package name.

Here's a screenshot

image

@EnglishDave
Copy link

EnglishDave commented Feb 18, 2021

This is definitely a problem with a clash between Xamarin.Android.Support libraries and Xamarin.AndroidX & Xamarin.Android.Google.Material libraries, and an issue with the AndroidX automatic migration.

XF 5.0.x has a dependency on Android10, which requires the AndroidX libraries. The automatic migration tool is supposed to map the support libraries onto the correct AndroidX libraries so you don’t have to do any manual changes to call, but Xamarin doesn't guarantee it will work and recommend making the required manual changes to shift from the Android support libraries to AndroidX.

If you don’t explicitly reference the Android Support NuGets and instead reference them via the Xamarin.Forms package reference, then everything should be fine. Upgrading the XF NuGet should sort out the references correctly (however you may still find issues in your Android project if the auto conversion has issues, but unless you have a lot of XA stuff in there, any issues should be easy to fix). However, if you have explicit package references to Xamarin.Support NuGets these must be removed. Either let the XF Nuget pull in the Android Libraries by reference or add in the correct AndroidX Libraries manually (via Nuget or by editing the csproj file):

<PackageReference Include="Xamarin.AndroidX.Browser" Version="1.3.0.4" />
<PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.6" />
<PackageReference Include="Xamarin.AndroidX.Lifecycle.LiveData" Version="2.2.0.4" />
<PackageReference Include="Xamarin.Google.Android.Material" Version="1.2.1.1" />

Of course, this doesn’t mean that any third party libraries you use wont be impacted.

Here’s the ridiculous thing though. The latest version of VS2019 (16.8.5) has out of date templates for Android and Forms projects! The Android template references Android 9, instead of 10 or 11, and includes references to the old Xamarin.Android.Support packages! The Forms template references an old version of XF, which in turn references the old Xamarin.Android.Support packages, however at least with this they are package references so upgrading XF sorts out the issue.

@mshuf
Copy link

mshuf commented Feb 21, 2021

FYI - We have released a new internal build of Telerik.UI.for.Xamarin that contains the fix. Install 2021.1216.1-hotfix to all the projects in the solution.

  1. Open NuGet Package Manager for Solution
  2. Select the Telerik package source (or select "All")
  3. Check the "Include Prerelease" checkbox

If you already have Telerik.UI.forXamarin installed, the hotfix will appear as an available update. If you are starting fresh, search for the package name.

Here's a screenshot

image

Hi Lance,

Thanks for your efforts on this thus far. Whilst the hotfix package did fix the type error described in this thread, I did notice that the LoadOnDemand feature of RadListView subsequently stopped working. I've had to downgrade Xamarin.Google.Android.Material to v1.1.0.5 and use the latest stable release of Telerik UI v2021.1.119.1 which restored the functionality.

IsLoadOnDemandEnabled="True" LoadOnDemandMode="Automatic"

Is this also on your teams radar by any chance?

@LanceMcCarthy
Copy link

Is this also on your teams radar by any chance?

@mshuf I have escalated this to the dev team directly. So that we don't mix topics, lets continue the LoadOnDemand conversation here https://feedback.telerik.com/xamarin/1508021-android-automatic-loadondemand-stopped-working-for

@LanceMcCarthy
Copy link

All conflicts between native Telerik UI for Xamarin's native styles and Google new Material styles, are fixed in today's official release. v2021.1.224

@mshuf this also include the fix for the automaticl load on demand

@ivanmeling
Copy link

I created a new android project and added all the files used in the failed project. Then I setted the project to target android 10 and use the Migrate to AndroidX, added the required NuGet packages (Palette and Media) and everything compiled again

@Redth Redth removed the s/needs-info ❓ A question has been asked that requires an answer before work can continue on this issue. label Mar 22, 2021
@Redth Redth moved this from Needs Info to New in Triage Mar 30, 2021
@JustyProgrammmer
Copy link

Good morning dear. Thanks to everyone who contributed by sharing their problems and their solutions regarding this issue.
I had the same problem a few days ago after updating Xamarin.Forms (4.8 ...) to Xamarin.Forms 5.0.0.2012.
Since then, i was unable to build by displaying an error similar to the one highlighted in this post.

Below are the steps that solved the problem for me following tips and recommendations shared here and in other posts:

1 - Updated Xamarin.Forms to version 5.0.0.2012 (done initially)
(https://docs.microsoft.com/en-us/xamarin/xamarin-forms/release-notes/5.0/5.0.0-sr3)
(https://docs.microsoft.com/en-us/xamarin/xamarin-forms/troubleshooting/questions/forms5-migration)
2 - I performed the manual migration to AndroidX
(https://docs.microsoft.com/en-us/xamarin/xamarin-forms/troubleshooting/questions/forms5-migration)
3 - Update of the Telerik library to the latest stable version (2021.1.325.1) - For my case
4 - Installing Xamarin.Google.Android.Material 1.1.0.5

After the last step the build was successful.

Triage automation moved this from New to Closed Apr 14, 2021
@arunkumarpediredla
Copy link

I am also facing same issue,
still I am unable to find out the issue

@arvindrajachourasiya
Copy link

FYI - We have released a new internal build of Telerik.UI.for.Xamarin that contains the fix. Install 2021.1216.1-hotfix to all the projects in the solution.

  1. Open NuGet Package Manager for Solution
  2. Select the Telerik package source (or select "All")
  3. Check the "Include Prerelease" checkbox

If you already have Telerik.UI.forXamarin installed, the hotfix will appear as an available update. If you are starting fresh, search for the package name.

Here's a screenshot

image

Hi, what developer should do who are having Telerik 2019 subscription only and do not require to update it, will they not be able to use Xamarin 5.0+ features including Hot Reload just because of Telerik issue ?

In nuget package manager I am not getting Telerik packages above 2019. In that can what should I do ? please suggest me

@LanceMcCarthy
Copy link

LanceMcCarthy commented Jul 15, 2022

In nuget package manager I am not getting Telerik packages above 2019. In that can what should I do ? please suggest me

Hi, it sounds like your license expired in 2019 (a license gives you support for 1 year -minimum 6 releases: 3 major & 3 minor). If you want a new version, such as a new release in 2021 or 2022, you need to renew your license.

This Microsoft thread is not the appropriate place for this conversation as we're talking solely about the Telerik controls. Please take the following steps so that the folks at Progress Software (aka Telerik) we can help:

  1. Go to https://www.telerik.com/account/support-center
  2. Select "Contact Us" and then select "Licensing support"
  3. Explain that you need to upgrade to 2022

Edit - To respond to your comment about "not be able to use XF 5 features". Yes, if the base framework has a newer set of minimum requirements, then any 3rd party with those dependencies must also match that minimum version (i.e. you cannot use XF 4.x Android SDK targets with XF 5.x higher minimum Android SDK targets). Almost every major release comes with some breaking changes, but the jump to AndroidX (Android 10) was a big one that requires a recompilation using the AndroidX SDK features. It isn't backwards compatible. You'll even see this across almost every Xamarin.Forms library, including Microsoft's packages (e.g. no more Xamarin.Android.Support.v4 kind of stuff)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
s/unverified New report that has yet to be verified t/bug 🐛
Projects
Triage
  
Closed
Development

No branches or pull requests