utopia-rise / fmod-gdextension

FMOD Studio GDExtension bindings for the Godot game engine
MIT License
465 stars 49 forks source link

android build error "Activity cannot be converted to Godot" #114

Closed SneekeeStache closed 2 years ago

SneekeeStache commented 2 years ago

hello when i try to build my project for android i receive an error

Task :compileDebugJavaWithJavac FAILED
project/android/fmod/src/FmodSingleton.java:32: error: incompatible types: Activity cannot be converted to Godot

i had to add implementation instead of compile() and make my build.gradle immutable or else it would change the file back and tell me that there was no compile() methods.

piiertho commented 2 years ago

Hello ! What is your godot version ?

SneekeeStache commented 2 years ago

Hello ! What is your godot version ?

godot 3.4.4 fmod 2.02.07

piiertho commented 2 years ago

Just to be sure I understand before starting to reproduce, you followed: https://github.com/utopia-rise/fmod-gdnative#fmod-on-android-with-gdnative and then tried to export for android ?

I think this is because of this commit: https://github.com/godotengine/godot/commit/e99dc65b64bbc88fd05434508e985115f1fb11d0

Crash is on this line: https://github.com/utopia-rise/fmod-gdnative/blob/abe078b12210664c6a13b7ca351a9261b9ee6a31/demo/android/fmod/src/FmodSingleton.java#L32

Which is pretty useless because we only use it to print that we loaded fmod jar...

piiertho commented 2 years ago

@sneekee-stache can you try to replace demo/android/fmod/src/FmodSingleton.java by this one: https://github.com/utopia-rise/fmod-gdnative/blob/bugfix/android-export-plugin/demo/android/fmod/src/FmodSingleton.java ? To see if it fix it on your side

SneekeeStache commented 2 years ago

@piiertho it work, the project build itself but i don't have any sound playing on my phone, it play the sound on my pc tho.

edit: nevermind i found that you need to add

*.bank, *.ogg

to the export resources

bitbrain commented 2 years ago

@sneekee-stache @piiertho can this be closed?

piiertho commented 2 years ago

@sneekee-stache @piiertho can this be closed?

No, not until https://github.com/utopia-rise/fmod-gdnative/pull/119 is merged.