Tencent / ncnn

ncnn is a high-performance neural network inference framework optimized for the mobile platform
Other
20.14k stars 4.14k forks source link

安卓编译问题 #4158

Open Javacr opened 2 years ago

Javacr commented 2 years ago

编译系统: win10 android_ndk: 20.1.5948944 我在win10上可以成功build ncnn, 当我想在安卓设备上运行"./benchncnn 8 4 2 -1 1"时,我需要build一个安卓版本的,于是我按照官方教程操作,当我在我的win10系统上运行命令:

cmake -DCMAKE_TOOLCHAIN_FILE="%ANDROID_NDK%/build/cmake/android.toolchain.cmake"  -DANDROID_ABI="armeabi-v7a" -DANDROID_ARM_NEON=ON  -DANDROID_PLATFORM=android-14 .. -A x64

我遇到了以下的错误:

-- CMAKE_TOOLCHAIN_FILE = D:/Android/Sdk/ndk/20.1.5948944/build/cmake/android.toolchain.cmake
-- CMAKE_INSTALL_PREFIX = D:/project/ncnn/proncnn/ncnn/build-android-armv7/install
-- NCNN_VERSION_STRING = 1.0.20220818
-- android-14 is unsupported. Using minimum supported version 16.
CMake Error at CMakeLists.txt:48 (project):
  Failed to run MSBuild command:

    C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/MSBuild/Current/Bin/MSBuild.exe

  to get the value of VCTargetsPath:

    用于 .NET Framework 的 Microsoft (R) 生成引擎版本 16.11.2+f32259642
    版权所有(C) Microsoft Corporation。保留所有权利。

    生成启动时间为 2022/8/18 15:32:17。
    节点 1 上的项目“D:\project\ncnn\proncnn\ncnn\build-android-armv7\CMakeFiles\3.24.0\VCTargetsPath.vcxproj”(默认目标) 。
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(820,5): error : The BaseOutputPath/OutputPath property is not set for project 'VCTargetsPath.vcxproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='x64'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [D:\project\ncnn\proncnn\ncnn\build-android-armv7\CMakeFiles\3.24.0\VCTargetsPath.vcxproj]
    已完成生成项目“D:\project\ncnn\proncnn\ncnn\build-android-armv7\CMakeFiles\3.24.0\VCTargetsPath.vcxproj”(默认目标)的操作 - 失败。

    生成失败。

    “D:\project\ncnn\proncnn\ncnn\build-android-armv7\CMakeFiles\3.24.0\VCTargetsPath.vcxproj”(默认目标) (1) ->
    (_CheckForInvalidConfigurationAndPlatform 目标) ->
      C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\Microsoft.Common.CurrentVersion.targets(820,5): error : The BaseOutputPath/OutputPath property is not set for project 'VCTargetsPath.vcxproj'.  Please check to make sure that you have specified a valid combination of Configuration and Platform for this project.  Configuration='Debug'  Platform='x64'.  You may be seeing this message because you are trying to build a project without a solution file, and have specified a non-default Configuration or Platform that doesn't exist for this project. [D:\project\ncnn\proncnn\ncnn\build-android-armv7\CMakeFiles\3.24.0\VCTargetsPath.vcxproj]

        0 个警告
        1 个错误

    已用时间 00:00:00.10

  Exit code: 1

-- Configuring incomplete, errors occurred!
See also "D:/project/ncnn/proncnn/ncnn/build-android-armv7/CMakeFiles/CMakeOutput.log".

CMakeOutput.log中的提示是:

The target system is: Android - 1 - armv7-a
The host system is: Windows - 10.0.19044 - AMD64

请问有人遇到过相似的问题吗?

gVimer commented 7 months ago

请问下最后是怎么解决的?我也遇到这个问题了

super100pig commented 6 months ago

同问🥺