gradle bundleDebugAar step fails because of hermes-debug.aar reference

Viewed 570

I am maintaining a brownfield react-native application and I am migrating react-native version from 0.59.9 to 0.63.4. I completed the steps defined in changelog and upgrade helper, and I can run the app on an emulator, but when I try to build it I get this error on bundleDebugAar step:

> 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 :myapp-react-
integration project caused this error: /Users/.../node_modules/hermes-
engine/android/hermes-release.aar

Gradle version:

const val BUILD_TOOLS_VERSION = "30.0.1"
const val GRADLE_VERSION = "4.0.1"

Here is my build.gradle.kts:

plugins {
    id(BuildPlugins.androidLibrary)
    id(BuildPlugins.kotlinAndroid)
    id(BuildPlugins.kotlinAndroidExtensions)
    id(BuildPlugins.kotlinKapt)
    id(BuildPlugins.junit)
}

android{
    androidExtensions {
        isExperimental = true
    }
}

val react by extra {
    mapOf(
        "enableHermes" to true
    )
}

dependencies {

    // Dependencies for local unit tests
    // JUnit and Mockito
    junit5()
    mockito()
    testImplementation(TestLibraries.JUNIT4)

    api(Libraries.REACT_NATIVE)
    implementation("com.facebook.soloader:soloader:0.9.0")
    implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.1.0")


    implementation(Libraries.Tracking.SNOWPLOW)
    implementation(project(Libraries.Tracking.BRAZE_REACT_NATIVE))

    rx()
    dagger()
    firebase()
    implementation(Libraries.gson)
    implementation(Libraries.Timber)
    implementation(Libraries.AndroidX.PREFERENCE)
    implementation(TestLibraries.Espresso.IDLING)
    androidTestRuntimeOnly(TestLibraries.Junit5.RUNNER)

    /********************************************/
    /*                 REACT                    */
    /** ******************************************/
    val hermesPath = "$rootDir/node_modules/hermes-engine/android/"
    debugImplementation(files(hermesPath + "hermes-debug.aar"))
    releaseImplementation(files(hermesPath + "hermes-release.aar"))
}

I would be happy if someone could help.

Thanks.

0 Answers
Related