Closed J-Swift closed 2 years ago
There's been some breaking changes in a recent version of Maui that we need to adapt to. Joys of supporting preview libraries.
We'll be doing another Maui release this week for our library to grab the latest changes.
Thanks for the issue.
No worries, I figured as much. I'm well aware of the joys of targeting a preview 😄. When I poked around it seemed to me you already were compliant w/ the nint change so I wasn't sure if this was a regression or not.
I appreciate the time you put into the library!
Try the latest sub-release. Haven't done much other than let it use the latest maui version to compile.
Just did a quick rebuild and it seems to still have the same issue. I'll give it a look tomorrow to see if theres any workarounds (or wait until preview 13 hits which I estimate should be soonish).
OK I lied, I did a quick extra test and tried to workaround any stripping that might be happening...
This code
var x = new ReactiveUI.ReactiveCollectionViewSource<int>(null);
var _ = x.NumberOfSections(null);
Gives
error CS7069: Reference to type 'nint' claims it is defined in 'Xamarin.iOS', but it could not be found
now I'm stopping until tomorrow to look further : )
OK, so Monday update.
I saw you put out 17.1.50. Tried that out and unfortunately its the same issue as before.
I found a possible workaround though, so maybe it will guide what the issue might be. I was able to download and reference ReactiveUI directly and build that way. I had to do a couple things though to make the build work:
TargetFrameworks
to net6.0;net6.0-ios
(previously this was net6.0-android;net6.0-ios
. The IL stripping failed if I didn't include net6.0
.TargetFrameworks
in ReactiveUI/ReactiveUI.csproj
to net6.0;net6.0-ios
, otherwise build will fail because it lists a bunch of unknown frameworks (e.g. tvOS)ReactiveUI.Fody
and ReactiveUI
from my references, and handwrite the helpers. Not sure what the issue with Fody was here.So, my csproj
references changed from
<ItemGroup>
<PackageReference Include="ReactiveUI" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Fody" Version="17.1.50" />
<PackageReference Include="ReactiveUI.Maui" Version="17.1.50" />
</ItemGroup>
to
<ItemGroup>
<ProjectReference Include="..\ReactiveUI\src\ReactiveUI.Maui\ReactiveUI.Maui.csproj" />
</ItemGroup>
This lets me generate and install an ipa file to a device locally, though I haven't tested on Testflight yet. I also had a weird bug where this suddenly didn't work, and the app would crash at runtime without AOT errors reported. I still don't know what happened but it seems a rm -rf {bin,obj}
and rebuild eventually fixed it.
Also note, I tried generating the DLLs locally and referencing them with HintPath
, but it gives the same AOT errors.
Yeah I'm likely at this stage just going to tag some Microsoft people into this issue on the Maui team and see if they can help on this one.
For what its worth, I asked about it in the dotnet discord today but didn't get any input (https://discord.com/channels/732297728826277939/732297808148824115/942818712703107122). You probably know better than me who/where to ask though
Discord
Discord is the easiest way to communicate over voice, video, and text. Chat, hang out, and stay close with your friends and communities.
@rolfbjarne thoughts?
@J-Swift you might also try uninstalling the daily dotnet sdk. Just use the dotnet sdk that's installed with the Visual Studio 2022 Public Preview
This is due to the breaking changes we're doing; everything needs to be using the same version of MAUI and the underlying iOS workload for things to work.
Try the latest sub-release. Haven't done much other than let it use the latest maui version to compile.
Exactly which maui version was this?
you might also try uninstalling the daily dotnet sdk. Just use the dotnet sdk that's installed with the Visual Studio 2022 Public Preview
@PureWeen Im not sure that will work since this is on a mac right? Im trying to avoid bringing VS for mac into this because it seemed to have messed some other things up when I installed it.
everything needs to be using the same version of MAUI and the underlying iOS workload for things to work
@rolfbjarne should I be able to generate a DLL on my machine and reference it with HintPath in that case? I tried that during the investigation and it gave the same AOT errors, but maybe I wasn't passing the right command to create the DLL? I'm ignorant to that process so definitely possible I wasn't using the right flags, etc
everything needs to be using the same version of MAUI and the underlying iOS workload for things to work
@rolfbjarne should I be able to generate a DLL on my machine and reference it with HintPath in that case? I tried that during the investigation and it gave the same AOT errors, but maybe I wasn't passing the right command to create the DLL? I'm ignorant to that process so definitely possible I wasn't using the right flags, etc
You mean you want to build ReactiveUI locally, and then reference that using HintPath in your project file?
I don't see why it shouldn't be possible to make that work (although it never is as simple as you'd think)
Well I dont want to : D I'm just saying I tried to do that at one point and it gave AOT errors, same as if it got generated by glenn. So I wasn't sure it was due to mismatch of toolchains/workloads since I was on the same machine that generated the DLL and had the same issue.
In any case, I was able to get the minimal repro yesterday so I'll work on getting that pushed just so we are all on the same page of the circumstances.
@rolfbjarne / cc @glennawatson: OK, well that took longer than I hoped. You can see my setup here: https://github.com/J-Swift/ReactiveUI-Maui-Repro
Hopefully the README is clear, but let me know if you have any questions.
GitHub
Contribute to J-Swift/ReactiveUI-Maui-Repro development by creating an account on GitHub.
P13 for .NET MAUI landed today
It might be worth getting latest RxUI bits compiled against that and then install P13 .NET MAUI
And see if life improves?
It might be worth getting latest RxUI bits compiled against that and then install P13 .NET MAUI
And see if life improves?
Yes, please try that!
@PureWeen AOT compilation still fails for the package, and that actually breaks my workaround of building locally because CarouselPage
is no longer public... have to see how much I have to delete to get it to compile again
Not too bad, just had to remove the ReactiveCarouselPage
. Ive created a branch to test repro on p13 as well (https://github.com/J-Swift/ReactiveUI-Maui-Repro/tree/p13)
GitHub
Contribute to J-Swift/ReactiveUI-Maui-Repro development by creating an account on GitHub.
Actually p13 just breaks the workaround entirely by crashing at runtime. I think because of this new warning
ReactiveUI.Maui.xml does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle
I'm really lost on all this.
Actually p13 just breaks the workaround entirely by crashing at runtime. I think because of this new warning
ReactiveUI.Maui.xml does not specify a 'PublishFolderType' metadata, and a default value could not be calculated. The file will not be copied to the app bundle
I'm really lost on all this.
Crash how exactly? And do you know what's supposed to happen to ReactiveUI.Maui.xml?
It looks like the crash is due to a zombie. I found out is is only if I reference both ReactiveUI
and ReactiveUI.Maui
. Removing references to ReactiveUI
fixes the runtime issue. I honestly don't even think that should compile, because I do reference ReactiveUI
in my project.
In any case, no I have no idea about any of this @rolfbjarne. All I know is the AOT fails when using the DLLs that I generate (and by extension, that get published to nuget) but somehow work if I build them as part of the compilation unit.
Was there a version mismatch between rxui and rxui Maui. Rxui.maui does include rxui
@glennawatson Not that I'm aware of. Theres spooky stuff going on. I had to add both Fody packages (Fody and Fody.Helpers), as well as ReactiveUI and ReactiveUI.Maui, and it appears I need to build them in that order as well, or else things don't compile, or observable events don't fire at runtime.
I've got a pretty unstable house of cards at the moment that allows me to produce signed adhocs that I've verified work through Firebase app distribution but since I have no idea why the current build setup seems to work (and I'm still unable to reference locally produced DLLs), I'm pretty worried it will just randomly break if I change anything else about the build.
@glennawatson brief update here: initial testing of the latest (v18.0.7) with Maui RC1 looks to fix the issues. I haven't fully tested but I'm optimistic.
A few days later and haven't noticed any issues. Closing as fixed. Thanks everyone!
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
I'm unable to build an AOT release build for iOS MAUI with ReactiveUI v17.1.17. Building with verbose gives me this
Steps To Reproduce
Not sure on a repro just yet, but it fails for me when doing the following build:
Expected behaviour
AOT compile works
Environment
Additional context
dotnet version: 6.0.200 (installed via daily
https://aka.ms/dotnet/6.0.2xx/daily/dotnet-sdk-osx-x64.pkg
) xcode version: 13.2.1 MAUI version: preview 12I installed the MAUI workload like this