_CreateAar step fails if you also have native libraries intended for Linux #8466
Open
Description
opened on Oct 27, 2023
Android application type
.NET Android (net7.0-android, etc.)
Affected platform version
.NET 7.0.308
Description
Given an SDK project targeting:
<TargetFrameworks>netstandard2.1;net6.0-ios;net6.0-android</TargetFrameworks>
And intended to be used on Android but also Linux, with native libraries, having the following structure:
libs
├── android
│ ├── arm64-v8a
│ │ └── lib.so
│ ├── armeabi-v7a
│ │ └── lib.so
│ ├── x86
│ │ └── lib.so
│ └── x86_64
│ └── lib.so
└── linux
├── linux-aarch64
│ └── lib.so
└── linux-x86_64
└── lib.so
Trying to build it, it fails with the given error, during the _CreateAar
step
libs/linux/linux-aarch64/lib.so : error XA4301: Cannot determine ABI of native library 'libs/linux/linux-aarch64/lib.so'. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.
libs/linux/linux-x86_64/lib.so : error XA4301: Cannot determine ABI of native library 'libs/linux/linux-x86_64/lib.so'. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.
Even excluding the files has no effect.
<None Remove="libs\linux\linux-x86_64\lib.so" />
<None Remove="libs\linux\linux-aarch64\lib.so" />
Steps to Reproduce
- Create a
Microsoft.NET.Sdk
project targetingnet6.0-android
- Create the
libs
structure defined in the description. - Try to build and notice the failure.
Did you find any workaround?
Just dirty hacks to be used around the _CreateAar
step to avoid these being identified by the pattern libs/[arch]/*.so
Relevant log output
libs/linux/linux-aarch64/lib.so : error XA4301: Cannot determine ABI of native library 'libs/linux/linux-aarch64/lib.so'. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.
libs/linux/linux-x86_64/lib.so : error XA4301: Cannot determine ABI of native library 'libs/linux/linux-x86_64/lib.so'. Move this file to a directory with a valid Android ABI name such as 'libs/armeabi-v7a/'.
Activity