Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ReactiveUI.Events - Linker error with Android 10 #2375

Closed
EmilienDup opened this issue Mar 30, 2020 · 9 comments
Closed

[BUG] ReactiveUI.Events - Linker error with Android 10 #2375

EmilienDup opened this issue Mar 30, 2020 · 9 comments

Comments

@EmilienDup
Copy link

Describe the bug
Impossible to link ReactiveUI.Events assembly on Android, with Android Target SDK 10.0

Steps To Reproduce

  1. Create a new xamarin android app
  2. Open project preferences
  3. Build > General > Compile using Android version: Android 10.0 (Q)
  4. Build > Android Build > Linker > Linker Options > Linker behaviour: Link SDK assemblies Only
  5. Add ReactiveUI.Events nuget package v 11.2.3
  6. Build the project

Expected behavior
The project builds successfully

Actual behavior
Build fails

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(5,5): Error XALNK7000: Mono.Linker.MarkException: Error processing method: 'System.Void Android.Media.RxAudioRecordEvents::<get_RoutingChanged>b__7_1(System.EventHandler`1<Android.Media.AudioRecord/RoutingChangedEventArgs>)' in assembly: 'ReactiveUI.Events.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Media.AudioRecord::add_RoutingChanged(System.EventHandler`1<Android.Media.AudioRecord/RoutingChangedEventArgs>)
  at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod (Mono.Cecil.MethodReference reference) [0x00013] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.MarkMethod (Mono.Cecil.MethodReference reference) [0x00049] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.MarkInstruction (Mono.Cecil.Cil.Instruction instruction) [0x00040] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.MarkMethodBody (Mono.Cecil.Cil.MethodBody body) [0x000c2] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.ProcessMethod (Mono.Cecil.MethodDefinition method) [0x001b1] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x0001b] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
   --- End of inner exception stack trace ---
  at Mono.Linker.Steps.MarkStep.ProcessQueue () [0x00047] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.ProcessPrimaryQueue () [0x0000a] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.Process () [0x000f6] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Steps.MarkStep.Process (Mono.Linker.LinkContext context) [0x0000d] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at MonoDroid.Tuner.MonoDroidMarkStep.Process (Mono.Linker.LinkContext context) [0x0000b] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Pipeline.ProcessStep (Mono.Linker.LinkContext context, Mono.Linker.Steps.IStep step) [0x0000d] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Mono.Linker.Pipeline.Process (Mono.Linker.LinkContext context) [0x0000f] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at MonoDroid.Tuner.Linker.Run (Mono.Linker.Pipeline pipeline, Mono.Linker.LinkContext context) [0x00000] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at MonoDroid.Tuner.Linker.Process (MonoDroid.Tuner.LinkerOptions options, Mono.Linker.ILogger logger, Mono.Linker.LinkContext& context) [0x00071] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Xamarin.Android.Tasks.LinkAssemblies.Execute (Java.Interop.Tools.Cecil.DirectoryAssemblyResolver res) [0x001dd] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Xamarin.Android.Tasks.LinkAssemblies.RunTask () [0x0001b] in <93105d8439ce45cf8f29caa4b3c699f9>:0 
  at Xamarin.Android.Tasks.AndroidTask.Execute () [0x00000] in <93105d8439ce45cf8f29caa4b3c699f9>:0  (XALNK7000) (Support)

Screenshots

Environment

=== Visual Studio Community 2019 for Mac (Preview) ===

Version 8.6 Preview (8.6 build 3437)
Installation UUID: a3b7188a-f47e-48f8-98e5-182f30462934
	GTK+ 2.24.23 (Raleigh theme)
	Xamarin.Mac 6.18.0.21 (d16-6 / a87d63c06)

	Package version: 610000095

=== Mono Framework MDK ===

Runtime:
	Mono 6.10.0.95 (2019-12/f2379f2d665) (64-bit)
	Package version: 610000095

=== Roslyn (Language Service) ===

3.6.0-2.20164.4+923b4bdbbd33307456464f4c90222a61af278972

=== NuGet ===

Version: 5.4.0.6315

=== .NET Core SDK ===

SDK: /usr/local/share/dotnet/sdk/3.1.200/Sdks
SDK Versions:
	3.1.200
	3.1.102
	3.1.100
	3.1.100-preview3-014645
	3.1.100-preview2-014569
	3.0.100
	3.0.100-rc1-014190
	3.0.100-preview9-014004
	3.0.100-preview7-012821
	2.1.701
	2.1.700
	2.1.505
	2.1.202
	2.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/6.10.0/lib/mono/msbuild/Current/bin/Sdks

=== .NET Core Runtime ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	3.1.2
	3.1.0
	3.1.0-preview3.19553.2
	3.1.0-preview2.19525.6
	3.0.0
	3.0.0-rc1-19456-20
	3.0.0-preview9-19423-09
	3.0.0-preview7-27912-14
	2.1.16
	2.1.14
	2.1.13
	2.1.12
	2.1.11
	2.1.9
	2.0.9
	2.0.3

=== Xamarin.Profiler ===

Version: 1.6.13.11
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Updater ===

Version: 11

=== Xamarin Designer ===

Version: 16.6.0.267
Hash: fa27dc7ce
Branch: remotes/origin/d16-6
Build date: 2020-03-19 20:26:14 UTC

=== Xamarin.Android ===

Version: 10.3.0.33 (Visual Studio Community)
Commit: xamarin-android/d16-6/e9fa8c4
Android SDK: /Users/emilien/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		8.1 (API level 27)

SDK Tools Version: 26.1.1
SDK Platform Tools Version: 29.0.6
SDK Build Tools Version: 29.0.2

Build Information: 
Mono: d90665a
Java.Interop: xamarin/java.interop/d16-6@2cab35c
ProGuard: xamarin/proguard/master@905836d
SQLite: xamarin/sqlite/3.31.1@49232bc
Xamarin.Android Tools: xamarin/xamarin-android-tools/d16-6@bfb66f3

=== Microsoft Mobile OpenJDK ===

Java SDK: /Users/emilien/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.6.0.46
Hash: f6bfa7b
Branch: remotes/origin/d16-6
Build date: 2020-03-13 00:13:30 UTC

=== Android Device Manager ===

Version: 16.6.0.75
Hash: 4509c53
Branch: remotes/origin/d16-6
Build date: 2020-03-13 00:13:52 UTC

=== Apple Developer Tools ===

Xcode 11.3.1 (15715)
Build 11C504

=== Xamarin.Mac ===

Version: 6.18.0.21 (Visual Studio Community)
Hash: a87d63c06
Branch: d16-6
Build date: 2020-03-02 11:17:04-0500

=== Xamarin.iOS ===

Version: 13.18.0.21 (Visual Studio Community)
Hash: a87d63c06
Branch: d16-6
Build date: 2020-03-02 11:17:05-0500

=== Xamarin Inspector ===

Version: 1.4.3
Hash: db27525
Branch: 1.4-release
Build date: Mon, 09 Jul 2018 21:20:18 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 806003437
Git revision: b6e23a27c18a3e6f8eb620ff1814fb76b3f47921
Build date: 2020-03-20 11:39:40-04
Build branch: release-8.6
Xamarin extensions: b6e23a27c18a3e6f8eb620ff1814fb76b3f47921

=== Operating System ===

Mac OS X 10.15.3
Darwin 19.3.0 Darwin Kernel Version 19.3.0
    Thu Jan  9 20:58:23 PST 2020
    root:xnu-6153.81.5~1/RELEASE_X86_64 x86_64

Related to #2083.
Does Reactive.Events supports only Android 9.0 and below?

@EmilienDup EmilienDup added the bug label Mar 30, 2020
@open-collective-bot
Copy link

open-collective-bot bot commented Mar 30, 2020

Hey @EmilienDup 👋,

Thank you for opening an issue. We will get back to you as soon as we can. Also, check out our Open Collective and consider contributing financially.

https://opencollective.com/reactiveui

PS.: We offer priority support for all financial contributors. Don't forget to add priority label once you start contributing 😄

An advanced, composable, functional reactive model-view-viewmodel framework for all .NET platforms!

@glennawatson
Copy link
Contributor

Thanks @EmilienDup I have an idea what this one be, but won't be fixed for a week or so.

@EmilienDup
Copy link
Author

Hi @glennawatson, noted!
Thanks for you quick response.

@lwschan
Copy link

lwschan commented May 3, 2020

@EmilienDup do you know which is the latest version for Reactive.Events that doesn't have this bug?

@glennawatson
Copy link
Contributor

It would still be an issue. I just been bogged down in real life to fix. All our stuff is set to android 9 at the moment

@lwschan
Copy link

lwschan commented May 3, 2020

Oh cool, thank you for the info!

@glennawatson glennawatson added this to To do in Bug Stomping via automation Jul 29, 2020
@glennawatson glennawatson self-assigned this Jul 29, 2020
@lwschan
Copy link

lwschan commented Sep 12, 2020

Any news on this bug? This is a bit annoying, because we have to disable linker in our app for the app to compile. So the app size is much bigger than it needs to be. :(

@glennawatson
Copy link
Contributor

Consider using Source Generator Events. It will only generate the code to the events you deliberately use so will reduce your linking size.

Bug Stomping automation moved this from To do to Done Aug 17, 2021
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
Bug Stomping
  
Done
Development

No branches or pull requests

4 participants