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

[0.75] Autolinking fails while building Android if a native module doesn't support Android #276

Closed
Tracked by #1901
tido64 opened this issue May 2, 2024 · 3 comments

Comments

@tido64
Copy link
Collaborator

tido64 commented May 2, 2024

Old Version

0.74

New Version

0.75.0-nightly-20240501-90663081d

Description

As of facebook/react-native@c57ca2c, autolinking fails on Android if any native module is missing an Android implementation:

Execution failed for task ':app:generateAutolinkingPackageList'.
> RNGP - Autolinking: Missing `packageImportPath` in `config` for dependency @rnx-kit/react-native-host. This is required to generate the autolinking package list.

Output of generated/autolinking/config-output.json:

{
  "root": "/~/react-native-test-app",
  "reactNativePath": "/~/react-native-test-app/node_modules/react-native",
  "reactNativeVersion": "0.75",
  "dependencies": {
    "@rnx-kit/react-native-host": {
      "root": "/~/react-native-test-app/node_modules/@rnx-kit/react-native-host",
      "name": "@rnx-kit/react-native-host",
      "platforms": {
        "ios": {
          "podspecPath": "/~/react-native-test-app/node_modules/@rnx-kit/react-native-host/ReactNativeHost.podspec",
          "version": "0.4.7",
          "configurations": [],
          "scriptPhases": []
        },
        "android": null
      }
    }
  },
  ...
}

Steps to reproduce

git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version nightly
yarn
cd example/android/
./gradlew :app:generateAutolinkingPackageList

Affected Platforms

Runtime - Android

Output of npx react-native info

n/a

Stacktrace or Logs

n/a

Reproducer

https://github.com/microsoft/react-native-test-app

Screenshots and Videos

No response

@cortinico
Copy link
Collaborator

Thanks for the report. This is a valid bug, I'll be fixing it in the next minutes

cortinico added a commit to cortinico/react-native that referenced this issue May 2, 2024
…`android` block

Summary:
The current core autolinking is failing if a dependency doesn't have an `android` block.
Instead we should filter out all the dependencies that don't have an `android` definition when generating code.

Fixes reactwg/react-native-releases#276

Changelog:
[Internal] [Changed] - RNGP - Fix core Autolinking attemping to link dependencies without a `android` block

Differential Revision: D56876267
@cortinico
Copy link
Collaborator

Fix is here:

facebook-github-bot pushed a commit to facebook/react-native that referenced this issue May 3, 2024
…`android` block (#44385)

Summary:
Pull Request resolved: #44385

The current core autolinking is failing if a dependency doesn't have an `android` block.
Instead we should filter out all the dependencies that don't have an `android` definition when generating code.

Fixes reactwg/react-native-releases#276

Changelog:
[Internal] [Changed] - RNGP - Fix core Autolinking attemping to link dependencies without a `android` block

Reviewed By: blakef

Differential Revision: D56876267

fbshipit-source-id: 900b13bec697fceac50c994f277621a10e281410
@cortinico
Copy link
Collaborator

Closing as this should be fixed

kosmydel pushed a commit to kosmydel/react-native that referenced this issue May 6, 2024
…`android` block (facebook#44385)

Summary:
Pull Request resolved: facebook#44385

The current core autolinking is failing if a dependency doesn't have an `android` block.
Instead we should filter out all the dependencies that don't have an `android` definition when generating code.

Fixes reactwg/react-native-releases#276

Changelog:
[Internal] [Changed] - RNGP - Fix core Autolinking attemping to link dependencies without a `android` block

Reviewed By: blakef

Differential Revision: D56876267

fbshipit-source-id: 900b13bec697fceac50c994f277621a10e281410
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants