How to fix libcrypto.1.1.dylib’ (no such file)

build/macos/Build/Products/Debug/FluffyChat.app/Contents/Frameworks/libcrypto.1.1.dylib’ (no such file)

This error message typically occurs when you’re trying to run a Flutter app on macOS and the OpenSSL library is missing or outdated.

To fix this issue, you can try the following steps:

  1. Open Terminal and navigate to your Flutter project directory.
  2. Run the command flutter clean to remove the build cache.
  3. Run the command flutter doctor to check for any missing dependencies or issues with your Flutter installation. If there are any issues, follow the instructions provided by the doctor to resolve them.
  4. Run the command flutter run to build and run your app.

If the issue persists, you may need to install or update OpenSSL manually. Here are the steps to install OpenSSL using Homebrew:

  1. Install Homebrew by running the following command in Terminal: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  2. Install OpenSSL by running the command brew install openssl.
  3. Set the OPENSSL_ROOT_DIR environment variable to the OpenSSL installation directory by running the command export OPENSSL_ROOT_DIR=/usr/local/opt/openssl.
  4. Run the command flutter clean to remove the build cache.
  5. Run the command flutter doctor to check for any missing dependencies or issues with your Flutter installation. If there are any issues, follow the instructions provided by the doctor to resolve them.
  6. Run the command flutter run to build and run your app.

Install Success!

==> Fetching openssl@3
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/manifests/3.1.0
######################################################################## 100.0%
==> Downloading https://ghcr.io/v2/homebrew/core/openssl/3/blobs/sha256:64e237e9
==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sh
######################################################################## 100.0%
==> Pouring [email protected]
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
  /usr/local/etc/openssl@3/certs

and run
  /usr/local/opt/openssl@3/bin/c_rehash

openssl@3 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

If you need to have openssl@3 first in your PATH, run:
  echo 'export PATH="/usr/local/opt/openssl@3/bin:$PATH"' >> ~/.zshrc

For compilers to find openssl@3 you may need to set:
  export LDFLAGS="-L/usr/local/opt/openssl@3/lib"
  export CPPFLAGS="-I/usr/local/opt/openssl@3/include"

For pkg-config to find openssl@3 you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
==> Summary
🍺  /usr/local/Cellar/openssl@3/3.1.0: 6,494 files, 29.9MB
==> Running `brew cleanup openssl@3`...

Hopefully, one of these steps will resolve the issue for you. If not, you may need to seek further assistance from the Flutter community or support team.

Related posts:

  1. Monitoring Battery Status in Your Flutter App with battery_plus
  2. How to use ChatGPT in Flutter? This is Basic Example
  3. Create circle ui navigator in flutter with library circle_ui_navigator