3

my local module package

libs folder

app/build.gradle file implementation

when I try to build android on expo with aar file, I get error called :react-native-akamaibmp:bundleReleaseLocalLintAar?

ERROR :

Task :react-native-akamaibmp:bundleReleaseLocalLintAar

Direct local .aar file dependencies are not supported when building an AAR. The resulting AAR would be broken because the classes and Android resources from any local .aar file dependencies would not be packaged in the resulting AAR. Previous versions of the Android Gradle Plugin produce broken AARs in this case too (despite not throwing this error). The following direct local .aar file dependencies of the :react-native-akamaibmp project caused this error

Does anyone has a solution for this?

1 Answer 1

1

I solved this by patching the package with the following build.gradle and copying the AAR file AkamaiBMP-X.X.X.aar to the libs folder of the main module.

Also, add to the main module dependencies:

implementation fileTree(dir: 'libs', include: ['AkamaiBMP*.aar'])

AkamaiBMP build.gradle

buildscript {
    repositories {
        google()
        mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

apply plugin: 'com.android.library'

android {
    compileSdk 34
    buildToolsVersion "34.0.0"

    defaultConfig {
        minSdkVersion 28
        targetSdkVersion 35
        versionCode 1
        versionName "1.0"
    }
    lintOptions {
        abortOnError false
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compileOnly fileTree(dir: 'libs', include: ['AkamaiBMP*.aar'])
    implementation 'com.facebook.react:react-native:+'
}
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.