Markus Haas
Markus Haas

Reputation: 11

How can I add a "aar" library to the AOSP?

I am building my own ROM and want to use a aar file Library in one system service.

Is there any way this could be achieved?

Upvotes: 0

Views: 1828

Answers (1)

Mykola Khyliuk
Mykola Khyliuk

Reputation: 1403

If you are using Android.bp this can be done via android_library_import module type (link to soong spec).

Also, if you try to grep the AOSP source tree, you will easily find many examples of its use, for example: packages/apps/Settings/Android.bp:

android_library_import {
name: "contextualcards",
aars: ["libs/contextualcards.aar"],
}

android_library {
name: "Settings-core",
....   
srcs: ["src/**/*.java"],
static_libs: [
    ...
    "contextualcards",
    ...
}

Upvotes: 1

Related Questions