utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
385 stars 42 forks source link

Android build is failing #124

Closed bitbrain closed 1 year ago

bitbrain commented 1 year ago
Run cp -r godot-cpp ../godot-cpp
scons: Reading SConscript files ...
src/gen: File exists
src/gen: File exists
scons: done reading SConscript files.
scons: Building targets ...
/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -o src/core/Transform.o -c --target=armv7a-linux-androideabi18 -march=armv7-a -fPIC -mfpu=neon -O3 -I. -Igodot-headers -Iinclude -Iinclude/gen -Iinclude/core src/core/Transform.cpp
sh: 1: /usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: not found
/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -o src/core/NodePath.o -c --target=armv7a-linux-androideabi18 -march=armv7-a -fPIC -mfpu=neon -O3 -I. -Igodot-headers -Iinclude -Iinclude/gen -Iinclude/core src/core/NodePath.cpp
sh: 1: /usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: not found
/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -o src/core/Quat.o -c --target=armv7a-linux-androideabi18 -march=armv7-a -fPIC -mfpu=neon -O3 -I. -Igodot-headers -Iinclude -Iinclude/gen -Iinclude/core src/core/Quat.cpp
sh: 1: /usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: not found
scons: *** [src/core/Transform.o] Error 127
scons: *** [src/core/NodePath.o] Error 127
scons: *** [src/core/Quat.o] Error 127
/usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -o src/core/GodotGlobal.o -c --target=armv7a-linux-androideabi18 -march=armv7-a -fPIC -mfpu=neon -O3 -I. -Igodot-headers -Iinclude -Iinclude/gen -Iinclude/core src/core/GodotGlobal.cpp
sh: 1: /usr/local/lib/android/sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++: not found
scons: *** [src/core/GodotGlobal.o] Error 127
scons: building terminated because of errors.
Error: Process completed with exit code 2.

This happens on the master branch for some reason.

bitbrain commented 1 year ago

Perhaps related to https://github.com/utopia-rise/fmod-gdnative/issues/114?

piiertho commented 1 year ago

Perhaps related to https://github.com/utopia-rise/fmod-gdnative/issues/114?

It is not, the failure is linked to a cpp compilation error because of ndk version

piiertho commented 1 year ago

The problem is that github runners now have a newer version of NDK by default.
But I got another problem. When I try to locally build android with right NDK version, I got weird behaviour:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
/Users/pierre-thomasmeisels/Library/Android/sdk/ndk/21.4.7075529/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ -o bin/libGodotFmod.android.release.arm64v8.so -Wl -shared --sysroot=/Users/pierre-thomasmeisels/Library/Android/sdk/ndk/21.4.7075529/platforms/android-21/arch-arm64/usr/lib   src/godot_fmod.os src/gdlibrary.os src/callback/file_callbacks.os src/callback/event_callbacks.os $( -L/Users/pierre-thomasmeisels/git/Godot-GDNative-Modules/godot-cpp/bin -L/Users/pierre-thomasmeisels/git/Godot-GDNative-Modules/libs/fmod/android/core/lib/arm64-v8a -L/Users/pierre-thomasmeisels/git/Godot-GDNative-Modules/libs/fmod/android/studio/lib/arm64-v8a $) -lgodot-cpp.android.release.arm64v8 -lfmod.so -lfmodstudio.so
ld: library not found for -lfmod.so
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
scons: *** [bin/libGodotFmod.android.release.arm64v8.so] Error 1
scons: building terminated because of errors.
bitbrain commented 1 year ago

@piiertho are you using MacOS? Looks like the 'library not found for' might be MacOS specific. Perhaps try running it with https://github.com/nektos/act instead might solve the issue?

piiertho commented 1 year ago

@piiertho are you using MacOS? Looks like the 'library not found for' might be MacOS specific. Perhaps try running it with https://github.com/nektos/act instead might solve the issue?

I always used macOS for my android builds :/

piiertho commented 1 year ago

Seems you're right, there's a problem with my mac: https://github.com/utopia-rise/fmod-gdnative/runs/7597666067?check_suite_focus=true

bitbrain commented 1 year ago

@piiertho awesome! Cherry-picked it onto the 4.x branch too