Open rgroenewoudt opened 1 year ago
@rgroenewoudt do you see some of the same issues with a .NET 6 console app? You can publish with win-x64
and win-x86
, for example.
The reason I'm asking, is this might actually be an issue with the .NET SDK/CLI -- and not the Android workload.
Hi @rgroenewoudt. We have added the "need-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
I am not sure how to check this as far I know assemblies/exe cannot contain both 32-bit and 64-bit? Isn't Android a bit different that it can contain multiple?
Wat I did is create new .NET 6 console app and ran dotnet publish twice and used different orders for win-x86;win-x64. I used DotPeek to look at the assembly (project.dll, not exe) and only when win-x64 was first, then the DLL was a 64-bit version (dotPeek uses the IMAGE_FILE_HEADER in PE file format)
Current dotnet version is 6.0.401 (6.0.9)
Is there an workaround to specifically build an APK with x86 and one without x86?
I think the problem here is the dotnet
CLI.
To workaround, you can put this in your project file:
<RuntimeIdentifiers Condition=" '$(No86)' == 'true' ">android-arm;android-arm64;android-x64</RuntimeIdentifiers>
And then pass -p:No86=true
from the command-line. You can name No86
whatever you like, and add appropriate logic as needed?
Thanks that works as a workaround. I forgot that conditions can be used in the project file.
Android application type
Android for .NET (net6.0-android, etc.)
Affected platform version
VS2022 17.3.4
Description
I would like to set the runtime identifiers (x86/arm) when using the dotnet publish CLI.
dotnet publish -c Release -p:RuntimeIdentifiers="android-x86;android-arm" -p:AndroidPackageFormat=apk -o test
However this doesn't seem to work, only the first runtime identifier is used. The APK only contains libraries for x86 and not arm. The same problem happens when an a different runtime identifier is used such as android-arm64.Steps to Reproduce
dotnet publish -c Release -p:RuntimeIdentifiers="android-x86;android-arm" -p:AndroidPackageFormat=apk -o test
Did you find any workaround?
No
Relevant log output
No response