Skip to content

Autolinking android regression #55653

Description

@Summys

Description

In React Native 0.84, the autolinking Gradle plugin (GeneratePackageListTask.kt) fails to generate correct fully qualified class names (FQCNs) when a library registers multiple React packages via react-native.config.js. Only the first package gets resolved; subsequent packages are emitted as bare class names with no import or qualification, causing a compilation error.

  • React Native: 0.84.0
  • Affected plugin: @react-native/gradle-plugin — GeneratePackageListTask.kt
  • Affected library (example): react-native-appsflyer@6.17.8

I think the bug was introduced here https://github.com/facebook/react-native/pull/54736/changes

Steps to reproduce

Any library that registers multiple packages in its react-native.config.js will trigger this:

// node_modules/react-native-appsflyer/react-native.config.js
module.exports = {
  dependency: {
    platforms: {
      android: {
        packageImportPath: [
          'import com.appsflyer.reactnative.RNAppsFlyerPackage;',
          'import com.appsflyer.reactnative.PCAppsFlyerPackage;',
        ].join('\n'),
        packageInstance: [
          'new RNAppsFlyerPackage()',
          'new PCAppsFlyerPackage()',
        ].join(',\n'),
      },
    },
  },
};

Expected generated PackageList.java

// react-native-appsflyer
new com.appsflyer.reactnative.RNAppsFlyerPackage(),
new com.appsflyer.reactnative.PCAppsFlyerPackage(),

Actual generated PackageList.java

// react-native-appsflyer
new com.appsflyer.reactnative.RNAppsFlyerPackage(),
new PCAppsFlyerPackage(),

React Native Version

0.84.0

Affected Platforms

Other (please specify), Runtime - Android

Output of npx @react-native-community/cli info

System:
  OS: macOS 26.3
  CPU: (12) arm64 Apple M3 Pro
  Memory: 5.38 GB / 36.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 24.11.1
    path: ~/.asdf/installs/nodejs/24.11.1/bin/node
  Yarn:
    version: 4.12.0
    path: ~/.asdf/installs/nodejs/24.11.1/bin/yarn
  npm:
    version: 6.14.16
    path: ~/Desktop/repositories/g1-monorepo/node_modules/.bin/npm
  Watchman:
    version: 2025.03.10.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.16.2
    path: /Users/marian.iordache/.asdf/shims/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 25.2
      - iOS 26.2
      - macOS 26.2
      - tvOS 26.2
      - visionOS 26.2
      - watchOS 26.2
  Android SDK:
    API Levels:
      - "31"
      - "33"
      - "34"
      - "35"
      - "36"
      - "36"
    Build Tools:
      - 34.0.0
      - 35.0.0
      - 35.0.1
      - 36.0.0
    System Images:
      - android-30 | Google APIs ARM 64 v8a
      - android-30 | Google Play ARM 64 v8a
      - android-34 | Google APIs ARM 64 v8a
      - android-36 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2025.2 AI-252.28238.7.2523.14688667
  Xcode:
    version: 26.2/17C52
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby:
    version: 3.4.4
    path: /Users/marian.iordache/.asdf/shims/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: true
iOS:
  hermesEnabled: true
  newArchEnabled: true

Stacktrace or Logs

Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Users/marian.iordache/Desktop/repositories/ReproducerAutolinking/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:60: error: cannot find symbol
new PCAppsFlyerPackage(),
    ^
  symbol:   class PCAppsFlyerPackage
  location: class PackageList
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler output below.
  /Users/marian.iordache/Desktop/repositories/ReproducerAutolinking/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:60: error: cannot find symbol
  new PCAppsFlyerPackage(),
      ^
    symbol:   class PCAppsFlyerPackage
    location: class PackageList
  1 error

* Try:
> Check your code and dependencies to fix the compilation error(s)
> Run with --scan to generate a Build Scan (Powered by Develocity).

BUILD FAILED in 8s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
/Users/marian.iordache/Desktop/repositories/ReproducerAutolinking/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:60: error: cannot find symbol
new PCAppsFlyerPackage(), ^ symbol: class PCAppsFlyerPackage location: class PackageList
1 error FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler output below. /Users/marian.iordache/Desktop/repositories/ReproducerAutolinking/android/app/build/generated/autolinking/src/main/java/com/facebook/react/PackageList.java:60: error: cannot find symbol new PCAppsFlyerPackage(), ^ symbol: class PCAppsFlyerPackage location: class PackageList 1 error * Try:
> Check your code and dependencies to fix the compilation error(s)
> Run with --scan to generate a Build Scan (Powered by Develocity). BUILD FAILED in 8s.
info Run CLI with --verbose flag for more details.

MANDATORY Reproducer

https://github.com/Summys/ReproducerAutolinking

Screenshots and Videos

No response

Activity

  1. muhammad-usman56 commented on Feb 21, 2026

    @muhammad-usman56

    We were able to unblock this by explicitly using fully qualified class names in packageInstance inside react-native.config.js.

    Instead of:

    packageInstance: [
    'new RNAppsFlyerPackage()',
    'new PCAppsFlyerPackage()',
    ].join(',\n'),

    we changed it to:

    packageInstance: [
    'new com.appsflyer.reactnative.RNAppsFlyerPackage()',
    'new com.appsflyer.reactnative.PCAppsFlyerPackage()',
    ].join(',\n'),

    After cleaning and rebuilding Android, the project compiles successfully on 0.84.0.

    This works because it bypasses the missing import resolution in the generated PackageList.java.

    Leaving this here in case it helps others until a proper fix lands upstream.

  2. janisievins commented on Feb 25, 2026

    @janisievins

    For me, changing both
    new RNAppsFlyerPackage() -> new com.appsflyer.reactnative.RNAppsFlyerPackage()
    and
    new PCAppsFlyerPackage() -> new com.appsflyer.reactnative.PCAppsFlyerPackage()

    caused PackageList.java to contain a wrong path (so, the build would keep failing, as expected):

    // react-native-appsflyer
    new com.appsflyer.reactnative.com.appsflyer.reactnative.RNAppsFlyerPackage(), <-- notice wrong path here
    new com.appsflyer.reactnative.PCAppsFlyerPackage(),
    

    So, the final patch that got it working for me was this:

    diff --git a/node_modules/react-native-appsflyer/react-native.config.js b/node_modules/react-native-appsflyer/react-native.config.js
    index 0f30744..9b1464d 100644
    --- a/node_modules/react-native-appsflyer/react-native.config.js
    +++ b/node_modules/react-native-appsflyer/react-native.config.js
    @@ -10,7 +10,7 @@ module.exports = {
             ].join('\n'),
             packageInstance: [
               'new RNAppsFlyerPackage()',
    -          'new PCAppsFlyerPackage()',
    +          'new com.appsflyer.reactnative.PCAppsFlyerPackage()',
             ].join(',\n'),
           },
         },
    

    react-native: "0.84.0"
    react-native-appsflyer: "^6.17.8"

  3. Summys commented on Feb 25, 2026

    @Summys
    Author

    I'm aware of these patches, but from what I'm seeing this looks like an extraction issue. The Gradle plugin now either requires a single import or handles import definitions differently. If that's intentional, it's a breaking change that should be clearly communicated to library maintainers. If it's not intentional, then it's likely a regression, especially since the imports are being defined in two different ways.

    https://github.com/facebook/react-native/pull/54736/changes#diff-34b9146e7310b8a1fad49272fcaf8a8028137f712752679ffd28d57810bdd4f6L68

  4. Summys commented on Mar 5, 2026

    @Summys
    Author
  5. cortinico commented on Mar 5, 2026

    @cortinico
    Contributor

    Yup this seems like a bug. Feel free to send a PR to fix it. We do have tests in place inside RNGP so should be an easy fix (you could ask an agent to do it for you).

    Once you're done please tag me in the PR.

    Also which library in the ecosystem is importing more than one package?

  6. react-native-bot commented on Sep 2, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

  7. added
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 2, 2026
  8. react-native-bot commented on Sep 2, 2026

    @react-native-bot
    Collaborator

    This issue is stale because it has been open for 180 days with no activity. It will be closed in 7 days unless you comment on it or remove the "Stale" label.

  9. removed
    StaleThere has been a lack of activity on this issue and it may be closed soon.
    on Sep 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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