I am creating an application with Flutter that uses a native library that I wrote myself in C++ to perform computationally intensive tasks. The library is compiled via Cmake and the compilation is automatically performed during the build task. The application compiles without error and I can launch it in the simulator or real hardware for debugging. But when I try to create an archive with Xcode I have the following error :
I set all my Cmake projects to have the bin directory “cmake-build-$CONFIGURATION” and by looking at the build log it seems like everything is properly configured. The script run by Xcode to create my library creates a release configuration and uses the directory cmake-build-Release as output. I don’t understand the error message. Why do I have to sign a source file? Why is the source file located in a -Debug folder for an archive when only -Release folder are created into my project directory? Do I have to configure some Cmake variables to properly sign everything?
The build log:
Configure native-shared
/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/ios/../native
Release
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk
CMAKE_OSX_DEPLOYMENT_TARGET=15.0
-- The C compiler identification is AppleClang 15.0.0.15000309
-- The CXX compiler identification is AppleClang 15.0.0.15000309
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release
build native-shared
/Applications/CMake.app/Contents/bin/cmake -P /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/CMakeFiles/VerifyGlobs.cmake
/Applications/CMake.app/Contents/bin/cmake -S/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native -B/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release --check-build-system CMakeFiles/Makefile.cmake 0
/Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/CMakeFiles /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release//CMakeFiles/progress.marks
/Users/adrien/dev/bin/make -f CMakeFiles/Makefile2 all
make[1]: Entering directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
/Users/adrien/dev/bin/make -f apple/CMakeFiles/apple-native.dir/build.make apple/CMakeFiles/apple-native.dir/depend
make[2]: Entering directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/apple /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/apple /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/apple/CMakeFiles/apple-native.dir/DependInfo.cmake "--color="
make[2]: Leaving directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
/Users/adrien/dev/bin/make -f apple/CMakeFiles/apple-native.dir/build.make apple/CMakeFiles/apple-native.dir/build
make[2]: Entering directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
[ 20%] Building CXX object apple/CMakeFiles/apple-native.dir/native.mm.o
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/apple && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -I/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native -O3 -DNDEBUG -std=gnu++11 -flto=thin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=15.0 -Wall -Wextra -ffast-math -MD -MT apple/CMakeFiles/apple-native.dir/native.mm.o -MF CMakeFiles/apple-native.dir/native.mm.o.d -o CMakeFiles/apple-native.dir/native.mm.o -c /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/apple/native.mm
make[2]: Leaving directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
[ 20%] Built target apple-native
/Users/adrien/dev/bin/make -f shared/CMakeFiles/shared-native.dir/build.make shared/CMakeFiles/shared-native.dir/depend
make[2]: Entering directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release && /Applications/CMake.app/Contents/bin/cmake -E cmake_depends "Unix Makefiles" /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared/CMakeFiles/shared-native.dir/DependInfo.cmake "--color="
make[2]: Leaving directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
/Users/adrien/dev/bin/make -f shared/CMakeFiles/shared-native.dir/build.make shared/CMakeFiles/shared-native.dir/build
make[2]: Entering directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
[ 40%] Building CXX object shared/CMakeFiles/shared-native.dir/src/chord_detection.cpp.o
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -I/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native -O3 -DNDEBUG -std=gnu++11 -flto=thin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=15.0 -Wall -Wextra -ffast-math -MD -MT shared/CMakeFiles/shared-native.dir/src/chord_detection.cpp.o -MF CMakeFiles/shared-native.dir/src/chord_detection.cpp.o.d -o CMakeFiles/shared-native.dir/src/chord_detection.cpp.o -c /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/chord_detection.cpp
/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/chord_detection.cpp:51:8: warning: unused variable 'bufferPos' [-Wunused-variable]
char *bufferPos = buffer;
^
/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/chord_detection.cpp:52:15: warning: unused variable 'resampledInputSize' [-Wunused-variable]
const size_t resampledInputSize = SignalSubResample(input, inputLength, inputSampleRate, alignedInput, CHORD_DETECTOR::NEEDED_SAMPLE_RATE);
^
/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/chord_detection.cpp:27:14: warning: unused variable 'harmonicRatio' [-Wunused-variable]
static float harmonicRatio[] = {1.0, 1.0595, 1.1225, 1.1892, 1.2599, 1.3348, 1.4142, 1.4983, 1.5874, 1.6818, 1.7818, 1.8877};
^
3 warnings generated.
[ 60%] Building CXX object shared/CMakeFiles/shared-native.dir/src/dsp.cpp.o
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -I/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native -O3 -DNDEBUG -std=gnu++11 -flto=thin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=15.0 -Wall -Wextra -ffast-math -MD -MT shared/CMakeFiles/shared-native.dir/src/dsp.cpp.o -MF CMakeFiles/shared-native.dir/src/dsp.cpp.o.d -o CMakeFiles/shared-native.dir/src/dsp.cpp.o -c /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/dsp.cpp
[ 80%] Building CXX object shared/CMakeFiles/shared-native.dir/src/pitch_detection.cpp.o
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -I/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native -O3 -DNDEBUG -std=gnu++11 -flto=thin -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.5.sdk -miphoneos-version-min=15.0 -Wall -Wextra -ffast-math -MD -MT shared/CMakeFiles/shared-native.dir/src/pitch_detection.cpp.o -MF CMakeFiles/shared-native.dir/src/pitch_detection.cpp.o.d -o CMakeFiles/shared-native.dir/src/pitch_detection.cpp.o -c /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/pitch_detection.cpp
/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/pitch_detection.cpp:31:14: warning: unused function 'ACF_2' [-Wunused-function]
static float ACF_2(const size_t begin, const unsigned int tau, const size_t W, const float *samples)
^
/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared/src/pitch_detection.cpp:111:14: warning: unused function 'ComputeSum' [-Wunused-function]
static float ComputeSum(const unsigned int tau, const float *samples)
^
2 warnings generated.
[100%] Linking CXX static library libshared-native.a
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared && /Applications/CMake.app/Contents/bin/cmake -P CMakeFiles/shared-native.dir/cmake_clean_target.cmake
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared && /Applications/CMake.app/Contents/bin/cmake -E cmake_link_script CMakeFiles/shared-native.dir/link.txt --verbose=1
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar" qc libshared-native.a "CMakeFiles/shared-native.dir/src/chord_detection.cpp.o" "CMakeFiles/shared-native.dir/src/dsp.cpp.o" "CMakeFiles/shared-native.dir/src/pitch_detection.cpp.o" "../apple/CMakeFiles/apple-native.dir/native.mm.o"
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib" libshared-native.a
Exporting shared-lib symbols
cd /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared && /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/objdump --source --demangle --disassemble /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/shared/libshared-native.a > /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/shared-native..dump
make[2]: Leaving directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
[100%] Built target shared-native
make[1]: Leaving directory '/Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release'
/Applications/CMake.app/Contents/bin/cmake -E cmake_progress_start /Users/adrien/Documents/Informatique/Mobile/MusicTraining/musictraining/native/cmake-build-Release/CMakeFiles 0