1

I am facing an issue with Android.bp file inside the prebuilts/sdk/current. I am able to include the file after downloading the aar file. But my requirement is to include the aar file link in the bp file. The code snippet from the bp file is mentioned below.

Working code

The aar file was copied to the path

android_library_import {
    name: "androidx.activity_activity-composelib-nodeps",
    aars: ["m2repository/androidx/compose/activity/activity/1.6.1/activity-compose-1.6.1.aar"],
    sdk_version: "31",
    apex_available: [
        "//apex_available:platform",
        "//apex_available:anyapex",
    ],
    min_sdk_version: "21",
  
}

Showing error while including aar file as link [mentioned below]

android_library_import {
    name: "androidx.activity_activity-composelib-nodeps",
    aars: ["https://maven.google.com/androidx/activity/activity-compose/1.6.1/activity-compose-1.6.1.aar"],
    sdk_version: "31",
    apex_available: [
        "//apex_available:platform",
        "//apex_available:anyapex",
    ],
    min_sdk_version: "21",
}

I am expecting the library import directly from the link instead of downloading it to a folder

1 Answers1

0

You cannot have the source tree getting updated during a build itself, so it is not recommended to fetch files from the internet at compile time in AOSP unlike Gradle. FWIW, the best bet is to have the file downloaded via a separate repo using repo sync and use the link file feature to add it to a pre-defined path in your Android.bp directory.

Rajat Gupta
  • 419
  • 3
  • 10