Skip to content

Build failure when not using app on android application module  #2129

@doniwinata0309

Description

@doniwinata0309

Description

Hi, I got build error when using reanimated V2 because my application module name is not app

error:
Build file '/Users/doni.winata/tvlk/district-traveloka/packages/apps/node_modules/react-native-reanimated/android/build.gradle' line: 10

Probably it related this code : https://github.com/software-mansion/react-native-reanimated/blob/master/android/build.gradle#L36

This is build.gradle inside our packages/apps/node_modules/react-native-reanimated/android/build.gradle'

import groovy.json.JsonSlurper;
configurations.maybeCreate("default")
def inputFile = new File(projectDir, '../../react-native/package.json')
def json = new JsonSlurper().parseText(inputFile.text)
def reactNativeVersion = json.version as String
def (major, minor, patch) = reactNativeVersion.tokenize('.')
def engine = "jsc"
if (project(':app').ext.react.enableHermes) {
    engine = "hermes"
}

artifacts.add("default", file("react-native-reanimated-${minor}-${engine}.aar"))

As we can see it trying to read app modules, while we are using appentry name on our app module.

Expected behavior

Using any name on application module should works

Actual behavior & steps to reproduce

Not using app name on application module will failed the build

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions