4

I'm trying to build my CMake project in Visual Studio 2019, but all of a sudden, after using this exact make file and setup for almost two weeks, it throws the error-

rebuilding 'build.ninja': subcommand failed

I didn't even know I was using ninja, didn't know it was installed and I haven't had any problems before. Any help would be appreciated!

GreenDiggy
  • 43
  • 1
  • 6
  • I have the same exact issue. I use the same local Android SDK and NDK packages, libraries, compiler etc. Nothing has changed, yet somehow, as soon as I connect to the internet and run a build, the defaults have magically changed. Failed to run MSBuild.exe to get the value of VCTargetsPath. Same on all 6 of my Windows boxes. How do we insure that the Android SDK / Gradle version doesn't change? – aquawicket Jan 04 '22 at 09:15

2 Answers2

2

Today I had an error like this, in Android Studio, and I found no solution, then I got angry and seeing that it said that there was an inconsistency in the projectandroid/app/.cxx folder, I went to file explorer, made show hidden files and deleted that folder, I went and cleaned the project and that was the solution LOL, if someone happens that, this can solve!

Osv Dev
  • 61
  • 6
0

It can be CMake cannot link to the include directories and the libraries. You can consider add the prefix path of those files in the CMakeList. For example:

set( OpenCV_DIR "E:/OpenCV/opencv/build" )    
set( OpenCV_INCLUDE_DIR "E:/OpenCV/opencv/build/include" )
Quang Tran
  • 11
  • 1
  • 3