xamarin / Xamarin.Forms

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

[Bug] Linker issue with Xamarin.Form 5.0.0.2125 #14646

Open EricNgo1972 opened 2 years ago

EricNgo1972 commented 2 years ago

Description

Issue described in ticket #13969 happens again with Xamarin Form 5.0.0.2125

I use VS for MAC 8.10.9(build 3)

Steps to Reproduce

  1. Create a Xamarin form project
  2. Compile in debug mode. It works fine
  3. Compile in release mode targeting android . It show the same exception as in ticket #13969. Targeting iOS has no problem.
  4. Go back to Xamarin.Forms 5.0.0.2083 -> no more exception

Basic Information

Environment

Show/Hide Visual Studio info ``` === Visual Studio Community 2019 for Mac === Version 8.10.9 (build 3) Installation UUID: e86f8516-8a0a-456b-a8ca-b31f7b24d5e7 GTK+ 2.24.23 (Raleigh theme) Xamarin.Mac 6.18.0.23 (d16-6 / 088c73638) Package version: 612000140 === Mono Framework MDK === Runtime: Mono 6.12.0.140 (2020-02/51d876a041e) (64-bit) Package version: 612000140 === Xamarin Designer === Version: 16.10.0.119 Hash: 36a2d986f Branch: remotes/origin/d16-10 Build date: 2021-06-02 19:41:34 UTC === Roslyn (Language Service) === 3.10.0-4.21269.26+029847714208ebe49668667c60ea5b0a294e0fcb === NuGet === Version: 5.9.0.7134 === .NET Core SDK === SDK: /usr/local/share/dotnet/sdk/5.0.401/Sdks SDK Versions: 5.0.401 5.0.400 5.0.301 5.0.203 5.0.202 5.0.201 5.0.103 5.0.102 5.0.101 5.0.100 3.1.413 3.1.412 3.1.410 3.1.409 3.1.408 3.1.407 3.1.406 3.1.405 3.1.404 3.1.403 3.1.402 3.1.401 3.1.302 3.1.301 3.1.300 3.1.202 3.1.200 3.1.102 3.1.101 3.1.100 3.0.101 3.0.100 2.1.505 2.1.302 MSBuild SDKs: /Applications/Visual Studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/Sdks === .NET Core Runtime === Runtime: /usr/local/share/dotnet/dotnet Runtime Versions: 5.0.10 5.0.9 5.0.7 5.0.6 5.0.5 5.0.4 5.0.3 5.0.2 5.0.1 5.0.0 3.1.19 3.1.18 3.1.16 3.1.15 3.1.14 3.1.13 3.1.12 3.1.11 3.1.10 3.1.9 3.1.8 3.1.7 3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.1 3.0.0 2.1.23 2.1.22 2.1.21 2.1.20 2.1.19 2.1.18 2.1.17 2.1.16 2.1.15 2.1.14 2.1.13 2.1.9 2.1.2 === .NET Core 3.1 SDK === SDK: 3.1.413 === Xamarin.Profiler === Version: 1.6.12.26 Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler === Updater === Version: 11 === Apple Developer Tools === Xcode 12.5 (18205) Build 12E262 === Xamarin.Mac === Version: 7.14.0.24 (Visual Studio Community) Hash: c4b89cddb Branch: d16-10 Build date: 2021-06-15 22:03:00-0400 === Xamarin.iOS === Version: 14.20.0.24 (Visual Studio Community) Hash: c4b89cddb Branch: d16-10 Build date: 2021-06-15 22:03:01-0400 === Xamarin.Android === Version: 11.3.0.4 (Visual Studio Community) Commit: xamarin-android/d16-10/ae14caf Android SDK: /Users/tung/Library/Developer/Xamarin/android-sdk-macosx Supported Android versions: 6.0 (API level 23) 8.1 (API level 27) SDK Tools Version: 26.1.1 SDK Platform Tools Version: 31.0.0 SDK Build Tools Version: 28.0.3 Build Information: Mono: b4a3858 Java.Interop: xamarin/java.interop/d16-10@f39db25 ProGuard: Guardsquare/proguard/v7.0.1@912d149 SQLite: xamarin/sqlite/3.35.4@85460d3 Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-10@c5732a0 === Microsoft OpenJDK for Mobile === Java SDK: /Users/tung/Library/Developer/Xamarin/jdk/microsoft_dist_openjdk_1.8.0.25 1.8.0-25 Android Designer EPL code available here: https://github.com/xamarin/AndroidDesigner.EPL === Android SDK Manager === Version: 16.10.0.13 Hash: 1b81df5 Branch: remotes/origin/d16-10 Build date: 2021-08-12 20:43:52 UTC === Android Device Manager === Version: 16.10.0.15 Hash: 89dcc0b Branch: remotes/origin/d16-10 Build date: 2021-08-12 20:44:10 UTC === Build Information === Release ID: 810090003 Git revision: 156eb53c9c668cb7ff4311ae3d1dab894549848b Build date: 2021-09-08 07:26:54-04 Build branch: release-8.10 === Operating System === Mac OS X 10.16.0 Darwin 20.1.0 Darwin Kernel Version 20.1.0 Sat Oct 31 00:07:11 PDT 2020 root:xnu-7195.50.7~2/RELEASE_X86_64 x86_64 ```

Workaround

Go back to 5.0.0.2083

jfversluis commented 2 years ago

Hey there, thanks for the report! Some time has passed, were you able to resolve it?

Could you make sure that you delete the bin & obj folders on the filesystem after you update and that all the Android packages are updated to the latest version?

It would also be really helpful if you could show a reproduction in a sample project.

Thanks!

MitchBomcanhao commented 2 years ago

We had a similar issue on a previous XF version, and had to add a dependency to an older Xamarin.AndroidX.Core package for the Android app to build in release mode When updating to XF sr5, we had to remove that dependency workaround for the app to build correctly.

lassana commented 2 years ago

Same here, we had Xamarin.AndroidX.RecyclerView 1.1.0.8 in the Android app csproj. Removing it fixes the linker error.

15mgm15 commented 1 year ago

@MitchBomcanhao Which Xamarin.AndroidX.Core sorry?

MitchBomcanhao commented 1 year ago

@15mgm15 not sure I understand your question?

15mgm15 commented 1 year ago

@MitchBomcanhao :

We had a similar issue on a previous XF version, and had to add a dependency to an older Xamarin.AndroidX.Core package for the Android app to build in release mode

Older Xamarin.AndroidX.Core. Do you remember the version by any chance?

MitchBomcanhao commented 1 year ago

@15mgm15 I'll try to see if I can find which one it was, will get back to you tomorrow

MitchBomcanhao commented 1 year ago

@15mgm15 Sorry Mario, I'm a bit late with my answer but this was the reference

<PackageReference Include="Xamarin.AndroidX.Core" Version="1.3.2.1" />

15mgm15 commented 1 year ago

Thanks a lot @MitchBomcanhao !