MAUI runtime identifier build hell
I have a class library that requires me to put in an RID to build it.
To build one of the projects on windows I need to set the
win-x64
RID
However when I build a MAUI project on android, I need the android-arm64
RID
I have set these:
Now it builds fine, but when I build the MAUI project it doesn't build it in a sub-directory for android-arm64
, when I build the class lib using dotnet build -f net9.0-android -r android-arm64
then the sub-directory is created.
so basically, the MAUI app is looking for the sub-directory that has the RID but that directory does not exist.
The MAUI build also works fine when I do the command dotnet build -f net9.0-android -r android-arm64
8 Replies
If you build it on Windows and nowhere in the project or the properties you specify the target framework, it will never apply the android runtime identifier. That's what your msbuild condition says
the second one should work tho
Only if you set the TargetFramework anywhere (either in the project or on the command line like you're doing now)
yes but shouldn't MAUI build for it automatically?
i don't see a reason for it to do that, unless there are some implicit target frameworks
i don't find it sensible for maui to assume what runtimes or frameworks you want to build for
either way, I now set the RID to only be there once the framework is windows
well no, you set it when the os you're compiling on is windows. not the os you're compiling for.
yeah I changed it