-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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]: WireUpControls throws exception in net8.0-android #3851
Comments
@ChrisPulman Do you perhaps have any clue about this? You fixed the same issue in #3714, so maybe your magic can solve this issue too 😇 |
Hi @gerardvanderkruijs I will try to take a look this weekend, unfortunately I am away until Friday evening so don't think I'll get much time until then. |
Hi @ChrisPulman , no worries that’s perfect! Thank you so much 🙏 |
@gerardvanderkruijs Just wondering if there is a specific requirement to use V19.6.12 |
@gerardvanderkruijs I did some research and as we are using reflection within ReactiveUI using linkers with AOT Compilation will not work as desired, the _Microsoft.Android.Resource.Designer.dll gets stripped of its code by being trimmed. I will see if I can find a way to do the same thing without using reflection. It seems that the _Microsoft.Android.Resource.Designer library may also not AOT friendly so may need to see what can be done about that first. If the legacy
With It is recommended to migrate to the new linker settings, as For the time being in your project I would set the following:
Then set the following:
Further Documentation can be found here Linking with .NET Android |
Trimming incompatibilities |
Hi @ChrisPulman , Thanks for the super clear explanation and for the (temp) solution! The reason we're still using
Also, there is no |
ReactiveUI.AndroidX was aimed at pre net6.0 targeted versions of Android, as far as I am aware you should be able to achieve the same with just the ReactiveUI base package. I will certainly check again though. |
Ah okay! Good to know. |
@ChrisPulman Were you by any chance able yet to have a look at this? |
@gerardvanderkruijs Hi, I was waiting for the latest release with net 8 support to reproduce the AndriodX functionality, they released the base packages on the 29th hopefully we can get a release out soon. Are we able to close this issue now? |
Hi @ChrisPulman! For now the |
<!-- Please be sure to read the [Contribute](https://github.com/reactiveui/reactiveui#contribute) section of the README --> **What kind of change does this PR introduce?** <!-- Bug fix, feature, docs update, ... --> Feature **What is the current behavior?** <!-- You can also link to an open issue here. --> #3851 **What is the new behavior?** <!-- If this is a feature change --> Functionality ported from the Mono Android TFM version that went out of support. Only supports Net 8.0 plus with the latest packages released on 29th August 2024 **What might this PR break?** No support for older targets if upgrading from the legacy package. **Please check if the PR fulfills these requirements** - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] Docs have been added / updated (for bug fixes / features) **Other information**:
Hi @ChrisPulman , |
working on some of that as we speak now, We had issues getting issued a certificate which has been solved. Hopefully today but can't promise depending on technical glitches I'm having |
Ah amazing @glennawatson ! |
I'm chasing up some certificate weirdness with the nuget team. Very strange stuff happening. |
Everything should be out now |
Hi @glennawatson (and maybe also @ChrisPulman ), I've installed the latest package releases ( On Android ( One small question regarding ReactiveUI/src/Directory.Packages.props Line 45 in 354d0ee
We use quite a lot of Firebase and GooglePlayServices packages and we're stuck again in a dependency loop because of version conflicts. If it's not too much to ask, maybe these can be updated as well in the next update? For the rest, I'm closing this issue |
Probably worth opening a new issue with the dependency issue with the other package for tracking |
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. |
Describe the bug 🐞
When calling
ReactiveUI.ControlFetcherMixin.WireUpControls()
in a .NET 8 Android app (net8.0-android
) in non-debug configuration, even though the correct resource ID is specified, aMissingFieldException
is thrown.This issue was fixed with bug report #3714 , but only for
Debug
builds by the looks of it. When deployingRelease
builds the exception is still present.I narrowed it down to one specific .csproj property, that is this one:
When I change this to
<AndroidLinkMode>None</AndroidLinkMode>
it all works perfectly.Stracktrace:
project .csproj file
Step to reproduce
8.0.302
)net8.0-android
project usingdotnet new android
command.ReactiveUI
version19.6.12
MainActivity.cs
and change it so thatMainActivity
inheritsReactiveUI.ReactiveActivity
android:id
) to theTextView
inactivity_main.xml
and add a member toMainActivity.cs
to wire it up.WireUpControls()
afterSetContentView()
inOnCreate()
.Release
configurationMissingFieldException
is thrown fromWireUpControls()
.AndroidLinkMode
toSdkOnly
in theDebug
config, this will result in same exception.Reproduction repository
https://github.com/gerardvanderkruijs/ReactiveUI-WireUpControls-Issue
Expected behavior
After launching the application In
Release
configuration, theTextView
should be wired up correctly, and the initial screen should be displayed.AndroidLinkMode
set toSdkOnly
should not throw aMissingFieldException
.Screenshots 🖼️
No response
IDE
Rider macOS
Operating system
Android
Version
13
Device
Emulator
ReactiveUI Version
19.6.12
Additional information ℹ️
Since this report is almost identical to #3714 I mainly used all the info and sample project provided by @tommy10344, so thank you for that :-)
The text was updated successfully, but these errors were encountered: