Skip to content

Android Build Failure When Locking Dependencies Could not resolve app.notifee:core:+. #1079

@Jad-Jbara

Description

@Jad-Jbara

Description

Build fails when locking gradle dependencies.

Note

this started happening after upgrading to "react-native": "0.74.3", where Gradle was upgraded to version 8.

Error Message

> Could not resolve all artifacts for configuration ':app:developmentDebugRuntimeClasspath'.
   > Could not resolve app.notifee:core:+.
     Required by:
         project :app > project :notifee_react-native
      > Failed to list versions for app.notifee:core.
         > Unable to load Maven meta-data from file:/Users/jadjbara/projects/......./node_modules/@notifee/react-native/android/libs/app/notifee/core/maven-metadata.xml.
            > org.xml.sax.SAXNotRecognizedException: Property 'http://javax.xml.XMLConstants/property/accessExternalSchema' is not recognized.

Project Specifics

  • react-native version: 0.74.3
  • notifee version: 7.8.2

Steps to Reproduce

  1. Enable gradle dependencies locking
    You can follow the guide on the official Gradle docs
    Steps are below:
    Add the following to your root android/build.gradle directory.
subprojects {
    configurations.all {
        it.resolutionStrategy.activateDependencyLocking()
    }
}

dependencyLocking {
    lockAllConfigurations()
}
  1. Build the app with adding --write-locks to the command for example in our case we are running ./android/gradlew -p ./android androidDependencies --write-locks

R&D

According to Gradle, depending on version 8 will lead to builds failing in case a dependency still uses legacy xml parsers.

How to Bypass the Error

The only way I could actually bypass the error was by disabling dependency locking in the project, which is not ideal since we would like to keep this in our repo.

Any idea how this can be resolved? Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Keep Openthis label avoids the stale bot

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions