找不到 "openssl" 提供的包配置文件

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

我正在尝试使用 dart:ffi 将 OpenSSL 与 Flutter 结合使用,但是当我 运行 Ubuntu 20.04 上的项目时,出现如下错误消息。我在 Windows 10 上测试了该项目并且它有效。

Project repository

CMakeLists.txt

cmake_minimum_required(VERSION 3.6)
project(flutter_openssl_crypto)

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:                                             
                                                                        
      opensslConfig.cmake                                               
      openssl-config.cmake                                              
                                                                        
    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 https://help.gradle.org                              
                                                                        
BUILD FAILED in 4s                                                      
Running Gradle task 'assembleDebug'...                                  
Running Gradle task 'assembleDebug'... Done                         5.3s
Exception: Gradle task assembleDebug failed with exit code 1

我如何 运行 Ubuntu 上的项目?

我发现了问题。 我已经为 Ubuntu 软件安装了 Android Studio 和 Flutter SDK,这就是问题所在。 当我从官方网站重新安装时,项目工作的。