Could not find a package configuration file provided by "openssl"


I’m trying to use OpenSSL with Flutter using dart:ffi, but when i run the project on Ubuntu 20.04 the error message as below comes out. I tested the project on Windows 10 and it worked.

Project repository


cmake_minimum_required(VERSION 3.6)

find_package(openssl REQUIRED CONFIG)

add_library(${PROJECT_NAME} SHARED empty.c)
target_link_libraries(${PROJECT_NAME} PRIVATE openssl::crypto)


CMakeLists.txt:6 (find_package):
    Could not find a package configuration file provided by "openssl" with any
    of the following names:                                             
    Add the installation prefix of "openssl" to CMAKE_PREFIX_PATH or set
    "openssl_DIR" to a directory containing one of the above files.  If 
    "openssl" provides a separate development package or SDK, be sure it has
    been installed.                                                     
* 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                              
BUILD FAILED in 4s                                                      
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                         5.3s
Exception: Gradle task assembleDebug failed with exit code 1

How can i run the project on Ubuntu?


I found the problem.
I had installed Android Studio and Flutter SDK for Ubuntu software, that’s the problem.
When I reinstalled both from the official websites, the project work’s.

Answered By – Cadu Gomes

Answer Checked By – Cary Denson (FlutterFixes Admin)

Leave a Reply

Your email address will not be published. Required fields are marked *