xamarin / Xamarin.Forms

Xamarin.Forms is no longer supported. Migrate your apps to .NET MAUI.
https://aka.ms/xamarin-upgrade
Other
5.62k stars 1.87k forks source link

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

Closed developer9969 closed 3 years ago

developer9969 commented 3 years ago

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!

` <?xml version="1.0" encoding="utf-8"?>

<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
hartez commented 3 years ago

@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 commented 3 years ago

@developer9969 Where does this generated XML come from?

PureWeen commented 3 years ago

@developer9969

developer9969 commented 3 years ago

@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 commented 3 years ago

@mattleibow ? Any thoughts?

developer9969 commented 3 years ago

@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 commented 3 years ago

image Same problem when update XF 4.8 to 5.0 lastest.

lu-nguyen-khoa commented 3 years ago

After Clean Solution and Rerun. It work fine..

developer9969 commented 3 years ago

@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 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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

developer9969 commented 3 years ago

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

dphamsafetrust commented 3 years ago

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

Exactly same :)

developer9969 commented 3 years ago

@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 commented 3 years ago

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

gabsterdev1 commented 3 years ago

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

@PureWeen @hartez any suggestions?

many thanks

BYES-PA commented 3 years ago

This happens with my project as well

developer9969 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

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

image

PureWeen commented 3 years ago

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

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 commented 3 years ago

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

image

My Company's project: image

lu-nguyen-khoa commented 3 years ago

Enable aap2: image

lu-nguyen-khoa commented 3 years ago

My project has been installed lastest: image

lu-nguyen-khoa commented 3 years ago

When click to error list, this file is open (path: obj\Debug\110\lp\181\jl\res\layout\mtrl_calendar_month_navigation.xml): image

developer9969 commented 3 years ago

@PureWeen thank you for your reply. I kind of dont understand how my repro proj just works for you. As soon as you download and build do you get the error?

See below again my repo and logs.

  1. I have the latest XForms for all projects
  2. I have the latest Android sdks and tools installed
  3. I have removed all the android support/AndroidX library from this repro proj and only installed (Xamarin.Android.Support.Design) as its necessary for TabbedPageNoShiftEffect.cs
  4. I have deleted bin/obj for the repro proj
  5. I have rebuild the project and I still get the same error
  6. I have downloaded the Project tool and attached a log
  7. Unchecking aapt2 causes errors like below. (left checked) image
  8. I have attached the logs but noticed that there are lots errors there in the diagnostic section Logs.zip
  9. MyRepo again SampleXF5.zip
  10. THE MOST IMPORTANT ONE. Downgrade to Xamarin.Forms 4.8.0.1560 AND ALL WORKS AND BUILD

I hope you guys can reproduce and fix it as is holding us up to use the community toolkit too.

developer9969 commented 3 years ago

@PureWeen see below video is 5 mins but you can skip as you see fit

  1. In the video I Run repro with Xamarin forms 4.5.8.1560 all works
  2. Show screen with Android skd installed
  3. Updated to 5.0.0.1874 Build fail
  4. Downgraded to 4.5.8.1560 all works ReproXF5Video.zip
BYES-PA commented 3 years ago
  • I would uninstall any support/androidx libraries you have installed and just let them transitively come from forms

@PureWeen This worked for me. I get other errors now, but I have yet to determine if they are related to this issue.

developer9969 commented 3 years ago

@BYES-PA hi there , did it work for you?did you have same error as me?

BYES-PA commented 3 years ago

@developer9969 Yes, uninstalling any support/androidx library worked. Yes, I had exactly the same error. I had another unrelated error (some xml error) which was fixed by setting the dex compiler from dx to d8.

dphamsafetrust commented 3 years ago
  • I would uninstall any support/androidx libraries you have installed and just let them transitively come from forms

@PureWeen this worked for me. Thank you so much.

Gmotagi commented 3 years ago

I Also have the same issue and tried everything in this thread with no luck.

Error failed linking file resources. XxxxApp.Android Error '10dp' is incompatible with attribute horizontalOffset (attr) float [weak] Error '5dp' is incompatible with attribute verticalOffset (attr) float [weak]

Running VS 16.8.4 Have set project min and target to Android 11, Api 30 - R Deleted bin/obj multiple times Have run the Migration tool.

Nothing worked with the final package references below.

  <PackageReference Include="Xamarin.Google.Android.Material" Version="1.2.1.1" />
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.5" />
    <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.5" />
    <PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.5" />
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1" />
    <PackageReference Include="Xamarin.Plugin.FilePicker">
      <Version>2.1.41</Version></PackageReference>
    <PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" />

(I also tried removing Cardview, MediaRouter & Legacy - same error) I then rolled back to the .csproj before I migrated and was prompted to install

    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0" />
    <PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.5" />

I did then built without runinig the migration tool and it builds and runs with the references below :-

    <PackageReference Include="Xamarin.Forms" Version="5.0.0.1874" />
    <PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" />
    <PackageReference Include="Xamarin.Android.Support.Design" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.Android.Support.v4" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.Plugin.FilePicker" Version="2.1.41" />
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0" />
    <PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.5" />

Horrible but for now that has me running forms 5 on Android until this gets properly fixed

PureWeen commented 3 years ago

@developer9969 (and anyone else still having the issue) can you try to attach a binlog using the following tool?

https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.ProjectSystemTools

You can also try to run

msbuild <yourproject> /bl

This will create a file called msbuild.binlog

If you don't feel comfortable attaching that file here then just email it to me shneuvil at microsoft.com

LanceMcCarthy commented 3 years ago

@PureWeen you can repro with my Microsoft MVP Companion app project. Instead of just cloning (it is a large solution), just pop in and see the csproj) https://github.com/LanceMcCarthy/MvpApi/blob/dev/src/MvpApi.Forms/Android/MvpApi.Forms.Android.csproj

[EDIT 1]

I get the same errors:

Severity    Code    Description Project File    Line    Suppression State
Error       failed linking file resources.  MvpApi.Forms.Android            
Severity    Code    Description Project File    Line    Suppression State
Error       '10dp' is incompatible with attribute horizontalOffset (attr) float [weak]. MvpApi.Forms.Android    C:\Source\GitHub\MvpApi\src\MvpApi.Forms\Android\obj\Debug\100\lp\97\jl\res\xml\standalone_badge_offset.xml 19  
Severity    Code    Description Project File    Line    Suppression State
Error       '5dp' is incompatible with attribute verticalOffset (attr) float [weak].    MvpApi.Forms.Android    C:\Source\GitHub\MvpApi\src\MvpApi.Forms\Android\obj\Debug\100\lp\97\jl\res\xml\standalone_badge_offset.xml 19  

I'm going to be pushing more changes as I try to fix this. to save the state of the setting, here are the package references.

  <ItemGroup>
    <PackageReference Include="Telerik.UI.for.Xamarin">
      <Version>2021.1.119.1</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.AndroidX.Core">
      <Version>1.3.2.1</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.AndroidX.Browser">
      <Version>1.3.0.4</Version>
    </PackageReference>
    <PackageReference Include="Xamarin.Forms" Version="5.0.0.1905" />
    <PackageReference Include="SkiaSharp" Version="2.80.2" />
    <PackageReference Include="SkiaSharp.Views " Version="2.80.2" />
    <PackageReference Include="SkiaSharp.Views.Forms " Version="2.80.2" />
    <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.6" />
    <PackageReference Include="Xamarin.Google.Android.Material" Version="1.2.1.1" />
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.6" />
    <PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.6" />
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1" />
    <PackageReference Include="Xamarin.AndroidX.VectorDrawable" Version="1.1.0.6" />
    <PackageReference Include="Xamarin.AndroidX.VectorDrawable.Animated" Version="1.1.0.6" />
    <PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.1.0.6" />
    <PackageReference Include="Xamarin.Android.Support.v8.RenderScript" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" />
    <PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.6" />
  </ItemGroup>

Here's a high level summary of how the project ended up in this state:

  1. I started with an older project that needed to be migrated to AndroidX.
  2. Once I completed the migration, I needed to update the packages that the migration tools uses (they're outdated).
  3. After finishing the support package updates, I updated to the latest XamarinForms (5.0)
  4. Do a clean and Rebuild of the android project head.
  5. Observe build error

[EDIT 2] - Success

I switched to using the implicit package restoration from XF nuspec and it now builds.

to be clear, here's what I did

  1. I deleted all of the AndroidX package references (except Palette and MediaRouter because they were suggested by the build system)
  2. Deleted the Android project's bin and obj folders
  3. Rebuild the Android project head

Success!

PureWeen commented 3 years ago

@LanceMcCarthy if you just remove this one

    <PackageReference Include="Xamarin.Google.Android.Material" Version="1.2.1.1" />

Does that also fix for you?

LanceMcCarthy commented 3 years ago

It was breaking when that package was explicitly listed.

Here's an easy comparison for you to put side-by-side

Works

  <ItemGroup>
    <PackageReference Include="Telerik.UI.for.Xamarin" Version="2021.1.119.1"/>
    <PackageReference Include="Xamarin.AndroidX.Core" Version="1.3.2.1"/>
    <PackageReference Include="Xamarin.AndroidX.Browser" Version="1.3.0.4"/>
    <PackageReference Include="Xamarin.Forms" Version="5.0.0.1905" />
    <PackageReference Include="SkiaSharp" Version="2.80.2" />
    <PackageReference Include="SkiaSharp.Views " Version="2.80.2" />
    <PackageReference Include="SkiaSharp.Views.Forms " Version="2.80.2" />
    <PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.6" />
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1" />
  </ItemGroup>

Does Not Work

  <ItemGroup>
    <PackageReference Include="Telerik.UI.for.Xamarin" Version="2021.1.119.1"/>
    <PackageReference Include="Xamarin.AndroidX.Core" Version="1.3.2.1"/>
    <PackageReference Include="Xamarin.AndroidX.Browser" Version="1.3.0.4"/>
    <PackageReference Include="Xamarin.Forms" Version="5.0.0.1905" />
    <PackageReference Include="SkiaSharp" Version="2.80.2" />
    <PackageReference Include="SkiaSharp.Views " Version="2.80.2" />
    <PackageReference Include="SkiaSharp.Views.Forms " Version="2.80.2" />
    <PackageReference Include="Xamarin.AndroidX.Legacy.Support.V4" Version="1.0.0.6" />
    <PackageReference Include="Xamarin.Google.Android.Material" Version="1.2.1.1" />
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.6" />
    <PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.6" />
    <PackageReference Include="Xamarin.AndroidX.VectorDrawable" Version="1.1.0.6" />
    <PackageReference Include="Xamarin.AndroidX.VectorDrawable.Animated" Version="1.1.0.6" />
    <PackageReference Include="Xamarin.AndroidX.RecyclerView" Version="1.1.0.6" />
    <PackageReference Include="Xamarin.Android.Support.v8.RenderScript" Version="28.0.0.3" />
    <PackageReference Include="Xamarin.AndroidX.Migration" Version="1.0.8" />
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1" />
    <PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.6" />
  </ItemGroup>
Gmotagi commented 3 years ago

I removed the Xamarin.Google.Android.Material line and it now builds & runs for me as well.

Relevant nugets after: -

    <PackageReference Include="Xamarin.Forms" Version="5.0.0.1874" />
    <PackageReference Include="Xamarin.AndroidX.AppCompat" Version="1.2.0.5" />
    <PackageReference Include="Xamarin.AndroidX.CardView" Version="1.0.0.5" />
    <PackageReference Include="Xamarin.AndroidX.MediaRouter" Version="1.2.0.1" />
    <PackageReference Include="Xamarin.Plugin.FilePicker">
      <Version>2.1.41</Version></PackageReference>
    <PackageReference Include="Xamarin.AndroidX.Palette" Version="1.0.0.5" />
developer9969 commented 3 years ago

@PureWeen FINALLY I have managed to build the solution , this was a complicated process has we had some android library that were having a mixture of Support and AndroidX.

I Removed all the android packages as you suggested and I let Visual studio tell me what it required. and finally built!!

the errors we were getting were not helping as it gave no idea where the problem was.

However now unfortunately the Azure Pipeline using 5.0 is failing for iOS with

MTOUCH : error MT2101: Can't resolve the reference 'System.Void UIKit.UIPageControl::set_AllowsContinuousInteraction(System.Boolean)', referenced from the method 'System.Void Xamarin.Forms.Platform.iOS.IndicatorViewRenderer::OnElementChanged(Xamarin.Forms.Platform.iOS.ElementChangedEventArgs1)' in 'Xamarin.iOS, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065'. `

Googled it but not much luck. We are using Microsoft Hosted agents!

I would hate to revert now bcse I cannot build the app in Azure Devops

mattleibow commented 3 years ago

You may need to update iOS on the agents: https://github.com/xamarin/Essentials/issues/1589#issuecomment-756600412

- script: |
    dotnet tool update --global boots
    boots --stable XamariniOS
PureWeen commented 3 years ago

It's good to see we've narrowed this down to a workaround but if someone who can recreate this issue could attach a binlog that would be really helpful

https://github.com/xamarin/Xamarin.Forms/issues/13303#issuecomment-762899187

I've tried the repro projects listed here and they all compile for me fine using the latest version of the google.materials library

mattleibow commented 3 years ago

I'll have a quick look. Not sure if I'll see anything, but there is no harm in letting my gut run on this :) Just updating to the latest stable of everything.

Gmotagi commented 3 years ago

I've sent you a link to my failing binlog to the email you posted previously.

mattleibow commented 3 years ago

So... Just starting from the top and trying the builds.

I created a new project, updated everything - making sure to use all the packages listed here. Seems to build for me.

Only thing different is that I did not add Telerik as it was not installed at the time. Installing now and will try again.

However, could someone try building this test project: App1.zip This is my binlog for a rebuild of the Android project: App1.Android_Debug_AnyCPU_Build_2021-01-21T20_24_21.1644064+02_00.binlog.zip

If someone can build that project and let me know if it works. And, regardless of if this project works, could you attach the binlog for this project so I can compare and see if I can spot something. I believe I am on the latest of all the bits, but maybe someone has something that stands out.

mattleibow commented 3 years ago

OK... I think I found what was causing the issue, but not how yet. So my sample app works fine, but now fails when I installed the Telerik package. Not sure what is up just yet, but for those using sample apps and also the test app above, could you test that and then install Telerik just to confirm it is that package?

EDIT I see the OP was using Syncfusion... I added all of them to my project, but no failures :( App1.Android_Debug_AnyCPU_Build_2021-01-21T20_44_53.4334615+02_00.binlog.zip

Gmotagi commented 3 years ago

I'm also using Telerik. The plot thickens!

Gmotagi commented 3 years ago

@mattleibow I tried your App1 project above and it builds and runs fine.

I then added in
<PackageReference Include="Telerik.UI.for.Xamarin" Version="2021.1.119.1" />

and I get the

Error failed linking file resources. App1.Android
Error '5dp' is incompatible with attribute verticalOffset (attr) float [weak]. App1.Android
Error '10dp' is incompatible with attribute horizontalOffset (attr) float [weak]. App1.Android

LanceMcCarthy commented 3 years ago

Coincidentally, I'm the Manager of Telerik Support in the US and can help out in digging deeper.

cc @didiyordanova are you aware of any known issues here?

@mattleibow I'm downloading your App1 test and sending it to Didi and the dev team. @Gmotagi If you would like to track our internal progress, open a BR here https://feedback.telerik.com/xamarin (click "Report a bug")

lu-nguyen-khoa commented 3 years ago

It still not working for me. No Solution really clean can fixing them.

LanceMcCarthy commented 3 years ago

Update: The issue was escalated and the Telerik development team is looking at this in depth today.

@haiduong741 The workaround is to let the Xamarin.Forms 5.x NuGet package restore its own dependencies (instead of you explicitly listing it).

What I mean by that is you should open your Android project's csproj file and remove the highlighted items in this screenshot:

image

After they have been removed, do a Clean and Rebuild.