Skip to content

_CreateAar step fails if you also have native libraries intended for Linux #8466

Open
@busec0

Description

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

  1. Create a Microsoft.NET.Sdk project targeting net6.0-android
  2. Create the libs structure defined in the description.
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.bugComponent does not function as intended.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions