firebase-unity-sdk: [Bug] Build this repo failed on windows

[REQUIRED] Please fill in the following fields:

  • Unity editor version: 2022.1.16f1
  • Firebase Unity SDK version: latest from repo
  • Source you installed the SDK: git repo
  • Problematic Firebase Component: source code
  • Other Firebase Components in use: -
  • Additional SDKs you are using: -
  • Platform you are using the Unity editor on: Windows
  • Platform you are targeting: Android
  • Scripting Runtime: -
  • Pre-built SDK from the website or open-source from this repo: This repo

[REQUIRED] Please describe the issue here:

Steps to reproduce:

I just clone this repo and run

python scripts/build_scripts/build_zips.py --platform=android

And it just got error below

Relevant Code:

cmd /C "C:\Python311\python.exe c:\Users\Brothers_Model\.vscode\extensions\ms-python.python-2022.18.2\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher 65148 -- C:\Users\Brothers_Model\Documents\git\firebase-unity-sdk/scripts/build_scripts/build_zips.py --platform=android "
I1201 15:47:22.586176 20768 build_zips.py:307] Use ANDROID_NDK_HOME(C:\Program Files\Unity\Hub\Editor\2022.1.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK) cmake toolchain(C:\Program Files\Unity\Hub\Editor\2022.1.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake\android.toolchain.cmake)
I1201 15:47:22.587175 20768 build_zips.py:779] cmake_setup_args is: cmake C:\Users\Brothers_Model\Documents\git\firebase-unity-sdk -DFIREBASE_INCLUDE_UNITY=ON -DFIREBASE_UNITY_BUILD_TESTS=ON -DFIREBASE_CPP_BUILD_STUB_TESTS=ON -DCMAKE_TOOLCHAIN_FILE=C:\Program Files\Unity\Hub\Editor\2022.1.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake\android.toolchain.cmake -DFIREBASE_ANDROID_BUILD=true -DCMAKE_BUILD_TYPE=release -DANDROID_STL=c++_shared
I1201 15:47:22.587175 20768 build_zips.py:781] Build android with multiple architectures armeabi-v7a,arm64-v8a,x86,x86_64
Using Toolchain File: C:\Program Files\Unity\Hub\Editor\2022.1.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake\android.toolchain.cmake
-- ANDROID_PLATFORM not set. Defaulting to minimum supported version
16.
CMake Error at CMakeLists.txt:129 (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.4.0+18d5aef85 for .NET Framework
    Build started 2022-12-01 15:47:22.
    Project "C:\Users\Brothers_Model\Documents\git\firebase-unity-sdk\android_unity\armeabi-v7a\CMakeFiles\3.25.0\VCTargetsPath.vcxproj" on node 1 (default targets).
    C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(832,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\Brothers_Model\Documents\git\firebase-unity-sdk\android_unity\armeabi-v7a\CMakeFiles\3.25.0\VCTargetsPath.vcxproj]
    Done Building Project "C:\Users\Brothers_Model\Documents\git\firebase-unity-sdk\android_unity\armeabi-v7a\CMakeFiles\3.25.0\VCTargetsPath.vcxproj" (default targets) -- FAILED.

    Build FAILED.

    "C:\Users\Brothers_Model\Documents\git\firebase-unity-sdk\android_unity\armeabi-v7a\CMakeFiles\3.25.0\VCTargetsPath.vcxproj" (default target) (1) ->
    (_CheckForInvalidConfigurationAndPlatform target) ->
      C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\amd64\Microsoft.Common.CurrentVersion.targets(832,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\Brothers_Model\Documents\git\firebase-unity-sdk\android_unity\armeabi-v7a\CMakeFiles\3.25.0\VCTargetsPath.vcxproj]

        0 Warning(s)
        1 Error(s)

    Time Elapsed 00:00:00.19


  Exit code: 1



-- Configuring incomplete, errors occurred!
See also "C:/Users/Brothers_Model/Documents/git/firebase-unity-sdk/android_unity/armeabi-v7a/CMakeFiles/CMakeOutput.log".
make: *** No targets specified and no makefile found.  Stop.
CPack Error: CPack generator not specified

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 31 (28 by maintainers)

Most upvoted comments

Hi @Thaina ,

It looks like your build system is missing some tools that are standard on linux but not on Windows, like patch.

'patch' is not recognized as an internal or external command

Usually these tools are installed as part of the Git command line tools for Windows, but you can also install it directly from chocolatey as described here. Alternatively, if you have the git command line tools for windows installed, you can attempt to open a git bash session and see if patch exists in the path there.

Hi @Thaina,

It’s my guess that the problem is a Visual Studio and cmake compatibility problem, considering that the .vcxproj file in question is generated by cmake.

There’s also a chance that the build configuration isn’t supported by the tools installed on your machine. Since the Firebase Unity SDK uses the Firebase C++ SDK implementation, the build that you’re executing will need to cross compile C++ code to ARM when you build the Firebase Unity SDK for Android. I believe you will need the Mobile development for C++ workload as described here.

If so then I would like to know which specific version of vs and vs tools you are using have a chance of success though?

We use GitHub Actions to build the SDK using the windows-latest runner, which resolves to windows-2022. This is technically Windows Server 2022. The GitHub Action runner page lists all of the workloads that that come preinstalled for Visual Studio Enterprise 2022 and many of the workloads denote v17.4.33006.217.

One other thing to check, too. The build script that you executed is attempting to use a cmake toolchain file at this path:

C:\Program Files\Unity\Hub\Editor\2022.1.16f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK\build\cmake\android.toolchain.cmake

Could you make sure that there’s a file there?

Thanks!

Hi @Thaina,

I see your point and I apologize for my confusion.

This seems to be a fundamental problem with cmake and/or Visual Studio tools. I’m not sure there’s anything in this repo which would cause such an error. I did a search on “to get the value of VCTargetsPath:” and there seem to be a lot of results. This one in particular in the cmake forums hints that some versions of Visual Studio Tools have produced this issue in the past. Also the command line environment might be related.

Would it be possible for you to uninstall and reinstall Visual Studio tools, or maybe try it on a different development machine? Or do you have another version of the Visual Studio tools available to you?