Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[android] Do not import a linked Android.mk file if the library is not specifying a libraryName #1626

Conversation

cortinico
Copy link
Member

Summary:

Given a react-native config that has the following setup:

{
  "dependencies": {
    "react-native-awesome-module": {
      "root": "/Users/ncor/git/react-native/template/node_modules/react-native-awesome-module",
      "name": "react-native-awesome-module",
      "platforms": {
        "android": {
          "sourceDir": "/Users/ncor/git/react-native/template/node_modules/react-native-awesome-module/android",
          "packageImportPath": "import com.reactnativeawesomemodule.AwesomeModulePackage;",
          "packageInstance": "new AwesomeModulePackage()",
          "buildTypes": [],
          "componentDescriptors": [],
          "androidMkPath": "/Users/ncor/git/react-native/template/node_modules/react-native-awesome-module/android/build/generated/source/codegen/jni/Android.mk"
        }
      }
    }
  },

(note that libraryName is missing), you should not import the androidMkPath as the file is not going to be present. It will cause a build failure at compile time.

Test Plan:

I've tested this locally on my fork. Seems like there are no tests for this .gradle file so I'm unsure how to test this further.

@cortinico
Copy link
Member Author

See here for reference: facebook/react-native#33777 (comment)

Copy link
Member

@thymikee thymikee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Makes sense

@thymikee thymikee merged commit 0fb3d1b into react-native-community:main Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants