quiche icon indicating copy to clipboard operation
quiche copied to clipboard

Cross compiling on Windows for Android fails

Open t895 opened this issue 8 months ago • 11 comments

I followed the instructions in the readme to build for Android but I'm facing this error.

error: failed to run custom build command for `quiche v0.23.7 (C:\Users\clomb\Desktop\quiche\quiche)`

Caused by:
  process didn't exit successfully: `C:\Users\clomb\Desktop\quiche\target\debug\build\quiche-0e087bf04019ac4d\build-script-build` (exit code: 101)
  --- stdout
  CMAKE_GENERATOR_aarch64-linux-android = None
  CMAKE_GENERATOR_aarch64_linux_android = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-linux-android = None
  CMAKE_PREFIX_PATH_aarch64_linux_android = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-linux-android = None
  CMAKE_aarch64_linux_android = None
  TARGET_CMAKE = None
  CMAKE = None
  running: "cmake" "C:\\Users\\clomb\\Desktop\\quiche\\quiche\\deps/boringssl" "-DANDROID_ABI=arm64-v8a" "-DCMAKE_TOOLCHAIN_FILE=C:\\Users\\clomb\\AppData\\Local\\Android\\Sdk\\ndk\\28.0.13004108\\build/cmake/android.toolchain.cmake" "-DANDROID_NATIVE_API_LEVEL=21" "-DANDROID_STL=c++_shared" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\clomb\\Desktop\\quiche\\target\\aarch64-linux-android\\debug\\build\\quiche-e28078fb55f4d500\\out" "-DCMAKE_C_FLAGS= --target=aarch64-linux-android21" "-DCMAKE_CXX_FLAGS= --target=aarch64-linux-android21" "-DCMAKE_ASM_FLAGS= --target=aarch64-linux-android21" "-DCMAKE_BUILD_TYPE=Debug"
  -- Building for: Visual Studio 17 2022
  -- Configuring incomplete, errors occurred!

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


  CMake Error at CMakeLists.txt:9 (project):
    Failed to run MSBuild command:

      C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe

    to get the value of VCTargetsPath:

      MSBuild version 17.13.19+0d9f5a35a for .NET Framework
      Build started 4/11/2025 11:22:29 AM.

      Project "C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj" on node 1 (default targets).
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(843,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. [C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj]
      Done Building Project "C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj" (default targets) -- FAILED.

      Build FAILED.

      "C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj" (default target) (1) ->
      (_CheckForInvalidConfigurationAndPlatform target) ->
        C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(843,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. [C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj]

          0 Warning(s)
          1 Error(s)

      Time Elapsed 00:00:01.21


    Exit code: 1




  thread 'main' panicked at C:\Users\clomb\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cmake-0.1.54\src\lib.rs:1119:5:

  command did not execute successfully, got: exit code: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
note: If the build failed due to a missing target, you can run this command:
note:
note:     rustup target install aarch64-linux-android

The note at the end is misleading because I do have that target installed.

t895 avatar Apr 11 '25 16:04 t895

I made a previous comment (now deleted) that was pointing to the boring-sys/boring crates as a source of this issue, but I was just messing with too many variables.

Still generally unsure about what is happening here.

t895 avatar Apr 11 '25 17:04 t895

try to run with wsl or within virtual machine

muhammadyasir-dev avatar Apr 12 '25 09:04 muhammadyasir-dev

@muhammadyasir-dev Compiling in WSL is fine but building on Windows should work too

t895 avatar Apr 12 '25 17:04 t895

I followed the instructions in the readme to build for Android but I'm facing this error.

error: failed to run custom build command for `quiche v0.23.7 (C:\Users\clomb\Desktop\quiche\quiche)`

Caused by:
  process didn't exit successfully: `C:\Users\clomb\Desktop\quiche\target\debug\build\quiche-0e087bf04019ac4d\build-script-build` (exit code: 101)
  --- stdout
  CMAKE_GENERATOR_aarch64-linux-android = None
  CMAKE_GENERATOR_aarch64_linux_android = None
  TARGET_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-linux-android = None
  CMAKE_PREFIX_PATH_aarch64_linux_android = None
  TARGET_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-linux-android = None
  CMAKE_aarch64_linux_android = None
  TARGET_CMAKE = None
  CMAKE = None
  running: "cmake" "C:\\Users\\clomb\\Desktop\\quiche\\quiche\\deps/boringssl" "-DANDROID_ABI=arm64-v8a" "-DCMAKE_TOOLCHAIN_FILE=C:\\Users\\clomb\\AppData\\Local\\Android\\Sdk\\ndk\\28.0.13004108\\build/cmake/android.toolchain.cmake" "-DANDROID_NATIVE_API_LEVEL=21" "-DANDROID_STL=c++_shared" "-DCMAKE_INSTALL_PREFIX=C:\\Users\\clomb\\Desktop\\quiche\\target\\aarch64-linux-android\\debug\\build\\quiche-e28078fb55f4d500\\out" "-DCMAKE_C_FLAGS= --target=aarch64-linux-android21" "-DCMAKE_CXX_FLAGS= --target=aarch64-linux-android21" "-DCMAKE_ASM_FLAGS= --target=aarch64-linux-android21" "-DCMAKE_BUILD_TYPE=Debug"
  -- Building for: Visual Studio 17 2022
  -- Configuring incomplete, errors occurred!

  --- stderr
  CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
    Compatibility with CMake < 3.10 will be removed from a future version of
    CMake.

    Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
    to tell CMake that the project requires at least <min> but has been updated
    to work with policies introduced by <max> or earlier.


  CMake Error at CMakeLists.txt:9 (project):
    Failed to run MSBuild command:

      C:/Program Files/Microsoft Visual Studio/2022/Community/MSBuild/Current/Bin/amd64/MSBuild.exe

    to get the value of VCTargetsPath:

      MSBuild version 17.13.19+0d9f5a35a for .NET Framework
      Build started 4/11/2025 11:22:29 AM.

      Project "C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj" on node 1 (default targets).
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(843,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. [C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj]
      Done Building Project "C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj" (default targets) -- FAILED.

      Build FAILED.

      "C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj" (default target) (1) ->
      (_CheckForInvalidConfigurationAndPlatform target) ->
        C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(843,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. [C:\Users\clomb\Desktop\quiche\target\aarch64-linux-android\debug\build\quiche-e28078fb55f4d500\out\build\CMakeFiles\4.0.1\VCTargetsPath.vcxproj]

          0 Warning(s)
          1 Error(s)

      Time Elapsed 00:00:01.21


    Exit code: 1




  thread 'main' panicked at C:\Users\clomb\.cargo\registry\src\index.crates.io-1949cf8c6b5b557f\cmake-0.1.54\src\lib.rs:1119:5:

  command did not execute successfully, got: exit code: 1

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
note: If the build failed due to a missing target, you can run this command:
note:
note:     rustup target install aarch64-linux-android

The note at the end is misleading because I do have that target installed.

The error you're encountering indicates that the CMake build process for the quiche project is failing due to issues with the MSBuild configuration. Specifically, it mentions that the BaseOutputPath/OutputPath property is not set for the VCTargetsPath.vcxproj project, which suggests a mismatch between the specified configuration/platform and what is available.

Here are some steps to troubleshoot and resolve the issue:

Check CMake Version: Ensure you have a compatible version of CMake installed (preferably 3.10 or higher, as indicated by the warning).

Verify Visual Studio Configuration: Make sure that you have the correct Visual Studio components installed for building C++ projects, including the necessary workloads for Android development.

Set Correct Platform and Configuration: Ensure that you are specifying the correct platform (e.g., arm64-v8a) and configuration (e.g., Debug) in your CMake command. You might need to explicitly set these in your CMakeLists.txt or command line.

Check NDK Path: Verify that the path to the Android NDK in your CMake command is correct and that the NDK version is compatible with your project.

Run CMake Manually: Try running the CMake command manually in a terminal to see if you get more detailed error messages.

Environment Variables: Ensure that your environment variables (like ANDROID_NDK_HOME) are set correctly.

Clean Build: Sometimes, residual files from previous builds can cause issues. Try cleaning the build directory and rebuilding.

muhammadyasir-dev avatar Apr 13 '25 06:04 muhammadyasir-dev

I've already done all of these steps

t895 avatar Apr 17 '25 20:04 t895

you should move rust one version backward to do it maybe it can run.

muhammadyasir-dev avatar Apr 19 '25 11:04 muhammadyasir-dev

That's unrelated and will not help

t895 avatar Apr 19 '25 19:04 t895

The error indicates a configuration issue with MSBuild; ensure you have the correct Visual Studio components for Android development, verify your CMake version is 3.10 or higher, and check that the specified platform and configuration match your project settings.

muhammadyasir-dev avatar Apr 20 '25 05:04 muhammadyasir-dev

if this didn't help you then create a sample project with build files and try t o run it and if it runs make sure to copy its configuration over to your this project and change small things and try again.

muhammadyasir-dev avatar Apr 20 '25 05:04 muhammadyasir-dev

Hi @t895! Could you fix it for Windows? I experience the same issue

david-stroup avatar Nov 06 '25 16:11 david-stroup

@david-stroup Unfortunately no I just gave up and only build on macOS and Linux now

t895 avatar Nov 06 '25 16:11 t895