Compile Error with ./fbt on New Flipper Firmware

Hello, I have a problem with compiling ./fbt on the new Flipper firmware. The output from 5 days ago shows the error below, while on the old firmware, I can compile without any issues. Since half of the .fap files don’t work due to the firmware version, the same error occurs on my Windows computer as well. Some help please?

pele@pele:~/flipperzero-firmware$ ./fbt fap_dist
SDKCHK targets/f7/api_symbols.csv
API version 60.4 is up to date
CC applications/debug/expansion_test/expansion_test.c
applications/debug/expansion_test/expansion_test.c:34:10: fatal error: flipper.pb.h: No such file or directory
34 | #include <flipper.pb.h>
| ^~~~~~~~~~~~~~
compilation terminated.
CC applications/debug/subghz_test/scenes/subghz_test_scene_show_only_rx.c
CC applications/debug/subghz_test/scenes/subghz_test_scene_start.c
scons: *** [build/f7-firmware-D/.extapps/expansion_test/expansion_test.o] Error 1

********** FBT ERRORS **********
build/f7-firmware-D/.extapps/expansion_test/expansion_test.o: Error 1

API Version 60 is Dev Firmware? Pull the stable version from GitHub.

Thank you for the reply, but I didn’t quite understand what you meant. If you could simplify it. I downloaded from GitHub using git clone https://github.com/flipperdevices/flipperzero-firmware.git. Then I wanted to check the validity with ./fbt fap_dist, but I keep getting an error. Initially, the error was:

bashCopy code

pele@pele:~/flipperzero-firmware$ ./fbt fap_dist
scons: *** [build/f7-firmware-D/assets/compiled/protobuf_version.h] Source `assets/protobuf/Changelog' not found, needed by target `build/f7-firmware-D/assets/compiled/protobuf_version.h'.

********** FBT ERRORS **********
build/f7-firmware-D/assets/compiled/protobuf_version.h: Source `assets/protobuf/Changelog' not found, needed by target `build/f7-firmware-D/assets/compiled/protobuf_version.h'.

After adding this command, I got stuck here:

rubyCopy code

pele@pele-+:~/flipperzero-firmware$ touch ~/flipperzero-firmware/assets/protobuf/Changelog

Since then, I’ve been getting the error I mentioned above. Before this, I could do everything on the firmware that was before this one in the same way. I was able to create my animations and upload some apps to Flipper that are not supported due to API mismatch or something similar. Could you please explain in more detail and more simply? I wouldn’t like to use the older firmware. Thank you.

From the docu the command is git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.git … See GitHub - flipperdevices/flipperzero-firmware: Flipper Zero firmware source code

How you’ll get a specific source, read the git command documentation. For example git clone -b 90ae1f3 --recursive https://github.com/flipperdevices/flipperzero-firmware.git … You’ll find the branches at Releases · flipperdevices/flipperzero-firmware · GitHub
Don’t know how it works and start with the dev branch is ambitious.

I have tested it right now on an up-to-date Kali (yes, I know. Bad hacker skilz required …).

$ mkdir ~/tmp; cd ~/tmp
$ git clone --recursive GitHub - flipperdevices/flipperzero-firmware: Flipper Zero firmware source code
$ cd flipperzero-firmware
$ ./fbt

Works fine.

─$ ./fbt
        SDKCHK  targets/f7/api_symbols.csv
API version 60.4 is up to date
        CDB     build/f7-firmware-D/compile_commands.json
Linking build/f7-firmware-D as latest built dir (./build/latest/)
        DIST    dist_fw_dist
2024-03-30 22:21:27,522 [INFO] Firmware binaries can be found at:
        dist/f7-D                                       

(Second run, the first is much longer. I wanted the ‘API version’ line)

But this is the latest development state … I really don’t want to debug, when there is an error.

See git branch -r and find all possible git branches. For us origin\release

$ git checkout release
./fbt

[...]
        CC      applications/main/infrared/infrared_signal.c
API version 58.0 is up to date
        CC      applications/main/lfrfid/lfrfid_cli.c
[...]
Firmware size
.text         572880 (559.45 K)
.rodata       152716 (149.14 K)
.data           1744 (  1.70 K)
.bss            5184 (  5.06 K)
.free_flash   320900 (313.38 K)
        HEX     build/f7-firmware-D/firmware.hex
Linking build/f7-firmware-D as latest built dir (./build/latest/)
        BIN     build/f7-firmware-D/firmware.bin
firmware.bin:  178 flash pages (last page 65.53% full)
        DFU     build/f7-firmware-D/firmware.dfu
        DIST    dist_fw_dist
2024-03-30 22:27:21,113 [INFO] Firmware binaries can be found at:
        dist/f7-D                            

So both works in a pretty standard environment. So I believe your issue is the missing --recursive parameter at the git clone [...]

Thank you so much for the effort, well done, but the problem is still there. When I enter ./fbt, I get this:

bashCopy code

pele@pele:~/flipperzero-firmware$ ./fbt
	SDKCHK	targets/f7/api_symbols.csv
API version 60.4 is up to date
	APPS	build/f7-firmware-D/applications/applications.c
	CC	build/f7-firmware-D/applications/applications.c
	LINK	build/f7-firmware-D/firmware.elf
	INFO	
Loaded 121 app definitions.
Firmware modules configuration:
Service:
	 bt, cli, dialogs, dolphin, desktop, gui, input, loader, notification, power, storage
System:
	 js_app, updater_app, storage_move_to_sd
Archive:
	 archive
Settings:
	 bt_settings, notification_settings, storage_settings, power_settings, desktop_settings, passport, system_settings, expansion_settings, about
StartupHook:
	 rpc_start, crypto_start, infrared_start, nfc_start, subghz_start, lfrfid_start, onewire_start, ibutton_start, bt_start, power_start, locale, storage_start, loader_start, updater_start, storage_move_to_sd_start, expansion_start, js_app_start
MenuExternal:
	 subghz, lfrfid, nfc, infrared, gpio, ibutton, bad_usb, u2f
Package:
	 system_apps, main_apps, settings_apps, basic_services, main_apps_on_start
Firmware size
.text         587076 (573.32 K)
.rodata       153116 (149.53 K)
.data           1744 (  1.70 K)
.bss            5184 (  5.06 K)
.free_flash   306300 (299.12 K)
	BIN	build/f7-firmware-D/firmware.bin
	HEX	build/f7-firmware-D/firmware.hex
firmware.bin:  182 flash pages (last page 21.97% full)
	DFU	build/f7-firmware-D/firmware.dfu
Linking build/f7-firmware-D as latest built dir (./build/latest/)
	CDB	build/f7-firmware-D/compile_commands.json
	DIST	dist_fw_dist
2024-03-30 22:30:28,423 [INFO] Firmware binaries can be found at:
	dist/f7-D

Everything is fine now, but when I enter ./fbt fap_dist, I get this:

pele@pele-MS:~/flipperzero-firmware$ ./fbt fap_dist
	SDKCHK	targets/f7/api_symbols.csv
API version 60.4 is up to date
	APPCHK	build/f7-firmware-D/.extapps/microel_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/battery_test.fap
	APPCHK	build/f7-firmware-D/.extapps/example_apps_data.fap
	APPCHK	build/f7-firmware-D/.extapps/accessor.fap
	APPCHK	build/f7-firmware-D/.extapps/itso_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/hid_usb.fap
	APPCHK	build/f7-firmware-D/.extapps/rpc_debug.fap
	APPCHK	build/f7-firmware-D/.extapps/bt_debug.fap
	APPCHK	build/f7-firmware-D/.extapps/speaker_debug.fap
	APPCHK	build/f7-firmware-D/.extapps/text_box_test.fap
	APPCHK	build/f7-firmware-D/.extapps/display_test.fap
	APPCHK	build/f7-firmware-D/.extapps/uart_echo.fap
	APPCHK	build/f7-firmware-D/.extapps/umarsh_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/all_in_one_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/file_browser_test.fap
	APPCHK	build/f7-firmware-D/.extapps/js_notification.fal
	APPCHK	build/f7-firmware-D/.extapps/troika_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/blink_test.fap
	APPCHK	build/f7-firmware-D/.extapps/ibutton.fap
	APPCHK	build/f7-firmware-D/.extapps/mykey_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/crash_test.fap
	APPCHK	build/f7-firmware-D/.extapps/bad_usb.fap
	APPCHK	build/f7-firmware-D/.extapps/example_plugin2.fal
	APPCHK	build/f7-firmware-D/.extapps/gallagher_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/u2f.fap
	APPCHK	build/f7-firmware-D/.extapps/lfrfid.fap
	APPCHK	build/f7-firmware-D/.extapps/bip_parser.fal
	APPCHK	build/f7-firmware-D/.extapps/snake_game.fap

fbt: warning: build/f7-firmware-D/.extapps/gallagher_parser.fal: app may not be runnable. Symbols not resolved using firmware's API: {'GALLAGHER_CARDAX_ASCII', 'gallagher_deobfuscate_and_parse_credential'}
_validate_app_imports, line 307, in file "/home/pele/flipperzero-firmware/scripts/fbt_tools/fbt_extapps.py"

fbt: warning: build/f7-firmware-D/.extapps/troika_parser.fal: app may not be runnable. Symbols not resolved using firmware's API: {'mosgortrans_parse_transport_block'}
_validate_app_imports, line 307, in file "/home/pele/flipperzero-firmware/scripts/fbt_tools/fbt_extapps.py"
...
pele@pele:~/flipperzero-firmware$ ./fbt fap_dist
...
fbt: warning: build/f7-firmware-D/.extapps/gallagher_parser.fal: app may not be runnable. Symbols not resolved using firmware's API: {'GALLAGHER_CARDAX_ASCII', 'gallagher_deobfuscate_and_parse_credential'}
_validate_app_imports, line 307, in file "/home/pele/flipperzero-firmware/scripts/fbt_tools/fbt_extapps.py"

fbt: warning: build/f7-firmware-D/.extapps/troika_parser.fal: app may not be runnable. Symbols not resolved using firmware's API: {'mosgortrans_parse_transport_block'}
_validate_app_imports, line 307, in file "/home/pele/flipperzero-firmware/scripts/fbt_tools/fbt_extapps.py"
...

When I enter ./fbt fap_dist, I get this warning. So, I’m using Ubuntu and before this last update, I could compile .h and .c files into .fap files normally. I really have no idea what went wrong, maybe the files have different names. I’ve tried updating everything, and I also tried with an older version, and it works normally. I really don’t know if this is just happening to me, I really don’t understand what the problem is, the same thing happens with and without --recursive . Thank you for your patience.

Should work. It is just a warning, not an error.

But the developers seems to be aware about the first warning, see NFC: Add support for Gallagher access control (MIFARE Classic only) by nickmooney · Pull Request #3306 · flipperdevices/flipperzero-firmware · GitHub

Thank you so much for your effort and time in solving my problem. Happy and blessed Easter. You were right, the solution was indeed ‘git clone --recursive’. However, I’m still experiencing some strange issues since I cannot compile the .fap with ‘./fbt fap_dist’. When I do this on the new firmware, meaning a fresh one without private apps, it should compile in the ‘build/.extapps’ folder and all the .fap files should be there. I would then copy that file to the Flipper using qflipera. Now, I don’t have that ‘.extapps’ folder. I have something under the ‘dist’ folder, for example ‘games’, and only ‘snake.fap’ is there. I also have a problem with compiling files, especially when I put an app in ‘applications_user’, for example this:

pele@pele:~/flipperzero-firmware$ ./fbt fap_dist
	SDKCHK	targets/f7/api_symbols.csv
API version 60.4 is up to date
	CC	applications_user/hid_cookie/views/hid_cc.c
	CC	applications_user/hid_cookie/hid.c
In file included from applications_user/hid_cookie/hid.c:1:
applications_user/hid_cookie/hid.h:5:10: fatal error: furi_hal_bt_hid.h: No such file or directory
    5 | #include <furi_hal_bt_hid.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from applications_user/hid_cookie/views/hid_cc.c:2:
applications_user/hid_cookie/views/../hid.h:5:10: fatal error: furi_hal_bt_hid.h: No such file or directory
    5 | #include <furi_hal_bt_hid.h>
      |          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
scons: *** [build/f7-firmware-D/.extapps/cookie_bt/hid.o] Error 1
scons: *** [build/f7-firmware-D/.extapps/cookie_bt/views/hid_cc.o] Error 1

********** FBT ERRORS **********
build/f7-firmware-D/.extapps/cookie_bt/hid.o: Error 1
build/f7-firmware-D/.extapps/cookie_bt/views/hid_cc.o: Error 1

I still don’t know how to adjust this to make my apps work. I think something has changed because before I was able to compile all animations without any issues. There’s an API mismatch, and this has been going on for 8 days now. I rarely write and ask for help, but I’m really out of ideas, and thank you once again for your effort; I appreciate it. I hope you have the patience to help me further with this.

.extapps were hidden, and I managed to compile from Jamison Derek’s skeleton app, but I still have a question mark icon and an API mismatch. When I go to ‘continue’, it works, but it’s not quite right. I don’t know what the problem is; last time it was so simple, and everything worked, so I could even change some small things and discover. I pressed that the problem above was solved, but this is going deeper. Thank you, LupusE

I think this is the main Issue.

If you have a problem with the Firmware, come here … In that case the developers may won’t answer, but I am sure they will read.

If you add another App, please:

  1. … please compile it standalone. ./fbt fap_dist is misleading here.
  2. … the developer of an external app can support mich more than the people here. At least without specific context.

I tried just ./fbt icons proto dolphin_internal dolphin_ext resources , and it works without any issues. LupusE, you solved the problem, and I really appreciate it. These apps from Jamison might not work on the new firmware because something needs to be replaced in the code, I assume, as he still manages to compile and run at least the skeleton app, while Cookie Clicker has no chance, it just won’t work. Thank you so much for resolving the issue; I appreciate it since the main problem I had was fixed, and that was git clone --recursive https://github.com/flipperdevices/flipperzero-firmware.git . Somehow I missed the -recursive , so thank you for the help; who knows when I would have figured it out. Any further issues are not relevant to this topic