facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.68k stars 24.29k forks source link

Could not find method autoLinkLibrariesWithApp after upgrading to 0.75 #46288

Closed CommanderRedYT closed 1 month ago

CommanderRedYT commented 1 month ago

Description

After upgrading react-native to the newest version (0.75.2) and following the official upgrade guide, I am not able to build my app anymore because of the error below.

Steps to reproduce

  1. Upgrade react-native
  2. Follow the official upgrade guide
  3. Encounter this error

React Native Version

0.75.2

Affected Platforms

Build - MacOS, Build - Linux

Output of npx react-native info

System:
  OS: macOS 15.0
  CPU: (8) arm64 Apple M2
  Memory: 124.11 MB / 24.00 GB
  Shell:
    version: 3.2.57
    path: /bin/bash
Binaries:
  Node:
    version: 22.3.0
    path: /opt/homebrew/bin/node
  Yarn:
    version: 4.4.0
    path: /opt/homebrew/bin/yarn
  npm:
    version: 10.8.1
    path: /opt/homebrew/bin/npm
  Watchman:
    version: 2024.08.05.00
    path: /opt/homebrew/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /opt/homebrew/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.5
      - iOS 17.5
      - macOS 14.5
      - tvOS 17.5
      - visionOS 1.2
      - watchOS 10.5
  Android SDK:
    API Levels:
      - "34"
      - "35"
    Build Tools:
      - 34.0.0
      - 35.0.0
    System Images:
      - android-35 | Google Play ARM 64 v8a
    Android NDK: Not Found
IDEs:
  Android Studio: 2024.1 AI-241.18034.62.2411.12169540
  Xcode:
    version: 15.4/15F31d
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: 18.3.1
  react-native:
    installed: 0.75.2
    wanted: 0.75.2
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Stacktrace or Logs

info Installing the app...
> Task :gradle-plugin:settings-plugin:checkKotlinGradlePluginConfigurationErrors
> Task :gradle-plugin:shared:checkKotlinGradlePluginConfigurationErrors
> Task :gradle-plugin:shared:compileKotlin UP-TO-DATE
> Task :gradle-plugin:shared:compileJava NO-SOURCE
> Task :gradle-plugin:shared:processResources NO-SOURCE
> Task :gradle-plugin:shared:classes UP-TO-DATE
> Task :gradle-plugin:shared:jar UP-TO-DATE
> Task :gradle-plugin:settings-plugin:compileKotlin UP-TO-DATE
> Task :gradle-plugin:settings-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:settings-plugin:pluginDescriptors UP-TO-DATE
> Task :gradle-plugin:settings-plugin:processResources UP-TO-DATE
> Task :gradle-plugin:settings-plugin:classes UP-TO-DATE
> Task :gradle-plugin:settings-plugin:jar UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:checkKotlinGradlePluginConfigurationErrors
> Task :gradle-plugin:react-native-gradle-plugin:compileKotlin UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:compileJava NO-SOURCE
> Task :gradle-plugin:react-native-gradle-plugin:pluginDescriptors UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:processResources UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:classes UP-TO-DATE
> Task :gradle-plugin:react-native-gradle-plugin:jar UP-TO-DATE
13 actionable tasks: 3 executed, 10 up-to-date

info 💡 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/ccomm/Documents/opendtu-react-native/android/app/build.gradle' line: 55

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not find method autoLinkLibrariesWithApp() for arguments [] on extension 'react' of type com.facebook.react.ReactExtension.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 2s
info Run CLI with --verbose flag for more details.

Reproducer

https://github.com/OpenDTU-App/opendtu-react-native

Screenshots and Videos

No response

react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
  • If your bug is UI related: a Snack
  • If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
react-native-bot commented 1 month ago
:warning: Missing Reproducible Example
:information_source: We could not detect a reproducible example in your issue report. Please provide either:
tara-singh-danu commented 1 month ago

@CommanderRedYT You need to put "autolinkLibrariesWithApp()" inside the react{} block

CommanderRedYT commented 1 month ago

Actually, the problem was that I was too tired and one letter was written in wrong case. https://github.com/OpenDTU-App/opendtu-react-native/commit/69742fd31f0109d9e59769ce6b63bbec16a4f602