When building with Android, the build fails if the file that existed during the previous compilation no longer exists.
For example, it consists of the following in the first build.
Hello.cpp
Hello.h
Main.cpp
Main.h
And when I try to do the second build, it consists of the following.
Main.cpp
Main.h
The build fails in this or similar cases.
Sometimes the build fails even when new files are added.
If I delete the proj.android/app/.externalNativeBuild folder and compile it works fine.
This is the error content.
Build command failed.
Error while executing process C:\Cocos\AndroidSDK\cmake\3.6.4111459\bin\cmake.exe with arguments {--build C:\Cocos\Projects\BGMaker\proj.android\app\.externalNativeBuild\cmake\debug\arm64-v8a --target MyGame}
ninja: error: '../../../../../../Classes/MButton_.cpp', needed by 'CMakeFiles/MyGame.dir/Classes/MButton_.cpp.o', missing and no known rule to make it
Is there any problem in automating CMakeList.txt as below?
If you’re using Android Studio, it should automatically pick up the changes in the CMakeLists.txt, and re-syncs the project by calling CMake again, which re-builds the cached files. Is it not doing that, or are you not using Android Studio?
thank you for answering!
I’m using android studio.
I just removed some source files from the project and built it, but it didn’t re-sync automatically.
I understand why it is a problem.
However in the question you linked to, the questioner says that you can do ‘touch CMakeLists.txt’. What is this?
I am using windows and tried typing in cmd but nothing happened.
Thank you!!