Skip to content

[Android] buildCMakeDebug race condition: libNitroModules.so not found #3163

@jslok

Description

@jslok

When building for Android, the build intermittently fails with a linker error because IAP's buildCMakeDebug[arm64-v8a] task runs before react-native-nitro-modules has finished producing libNitroModules.so.

This fixed it for me. Add to android/build.gradle in react-native-iap:

  afterEvaluate {
      tasks.configureEach { task ->
          if (task.name.startsWith('buildCMake')) {
              def nitroProject = rootProject.findProject(':react-native-nitro-modules')
              if (nitroProject) {
                  def nitroTask = nitroProject.tasks.findByName(task.name)
                  if (nitroTask) {
                      task.dependsOn(nitroTask)
                  }
              }
          }
      }
  }

I have several nitro modules in my project. I am not sure why IAP is the only one with this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working🤖 androidRelated to android

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions