Noofbiz / hypnic

a game about falling/dreaming
MIT License
8 stars 0 forks source link

Gomobile can not build Hypnic game #18

Open TechComSpot opened 5 years ago

TechComSpot commented 5 years ago

Hi, @Noofbiz.

I am in Hypnic directory and did gomobile build but got errors: screenshot at 2018-11-24 10-09-37

Can you advice please ?

Noofbiz commented 5 years ago

Yeah you actually go into the androidglue folder then run 'gomobile bind --tags=mobilebind' and it'll generate an aar file that you then put into the android/androidglue folder. Then you can open android as a project in Android studio and build it as an apk there. I will put that in the readme when I get to it lol

TechComSpot commented 5 years ago

@Noofbiz thank you. But why gomobile build is not working here anymore? If I am not wrong it worked before the last time I study hypnic. Is it something related to engo engine?

Noofbiz commented 5 years ago

Actually, those two errors look like you're using old versions of oto and gl. In go 11 you can no longer not initialize jni objects, you have to set them explicitly to zero, so oto had to be updated for that. Then gomobile changed the teximage2d signature, so gl had to be fixed. Running go get -u github.com/Noofbiz/hypnic should fix the errors.

TechComSpot commented 5 years ago

Hi, @Noofbiz.

Thank you for response. I did like you said go get -u github.com/Noofbiz/hypnic but got next error:

screenshot at 2018-11-27 13-21-23

Can you help, please.

Noofbiz commented 5 years ago

try going into the hypnic directory and doing git fetch or git checkout master

TechComSpot commented 5 years ago

Hi, @Noofbiz. I handled those errors but when came to androidglue directory and execute gomobile bind --tags=mobilebind got another errors: screenshot at 2018-11-30 01-39-47

Also when I try running hypnic this time I got: go run main.go ALSA lib pcm_dmix.c:1099:(snd_pcm_dmix_open) unable to open slave 2018/11/30 01:46:17 audio error. Unable to create new OtoPlayer: oto: ALSA error: Device or resource busy

fatal error: runtime.SetFinalizer: pointer not in allocated block

goroutine 1 [running, locked to thread]: runtime.throw(0x725602, 0x34) /usr/local/go/src/runtime/panic.go:608 +0x72 fp=0xc0001436f0 sp=0xc0001436c0 pc=0x46b912 runtime.SetFinalizer(0x6cb360, 0x0, 0x6708c0, 0xc0000101d0) /usr/local/go/src/runtime/mfinal.go:353 +0x72c fp=0xc0001437d8 sp=0xc0001436f0 pc=0x45970c engo.io/engo/common.(AudioSystem).New(0xc000024640, 0xc000126000) /home/r3mb00/GoMobile/src/engo.io/engo/common/audio.go:53 +0x175 fp=0xc000143830 sp=0xc0001437d8 pc=0x5d2165 engo.io/ecs.(World).AddSystem(0xc000126000, 0x7f768dd49c18, 0xc000024640) /home/r3mb00/GoMobile/src/engo.io/ecs/world.go:18 +0x157 fp=0xc000143880 sp=0xc000143830 pc=0x4f45b7 engo.io/ecs.(World).AddSystemInterface(0xc000126000, 0x7502a0, 0xc000024640, 0x664880, 0x0, 0x664ac0, 0x0) /home/r3mb00/GoMobile/src/engo.io/ecs/world.go:30 +0x7e fp=0xc000143928 sp=0xc000143880 pc=0x4f464e github.com/Noofbiz/hypnic/scenes/mainmenu.(Scene).Setup(0xc00009a108, 0x74e100, 0xc000126000) /home/r3mb00/GoMobile/src/github.com/Noofbiz/hypnic/scenes/mainmenu/scene.go:72 +0x198 fp=0xc000143b70 sp=0xc000143928 pc=0x606e58 engo.io/engo.SetScene(0x750760, 0xc00009a108, 0x552200) /home/r3mb00/GoMobile/src/engo.io/engo/scene.go:112 +0x2ff fp=0xc000143bd0 sp=0xc000143b70 pc=0x55350f engo.io/engo.RunPreparation(0x750760, 0xc00009a108) /home/r3mb00/GoMobile/src/engo.io/engo/engo_glfw.go:255 +0x53 fp=0xc000143bf8 sp=0xc000143bd0 pc=0x552103 engo.io/engo.runLoop(0x750760, 0xc00009a108, 0x100) /home/r3mb00/GoMobile/src/engo.io/engo/engo_glfw.go:267 +0x121 fp=0xc000143cb8 sp=0xc000143bf8 pc=0x552251 engo.io/engo.Run(0x0, 0x70df68, 0x6, 0x0, 0x140, 0x1e0, 0x3f8000003f800000, 0x100, 0x1e, 0x0, ...) /home/r3mb00/GoMobile/src/engo.io/engo/engo.go:227 +0x416 fp=0xc000143ee8 sp=0xc000143cb8 pc=0x550a36 main.main() /home/r3mb00/GoMobile/src/github.com/Noofbiz/hypnic/main.go:21 +0x102 fp=0xc000143f98 sp=0xc000143ee8 pc=0x6121e2 runtime.main() /usr/local/go/src/runtime/proc.go:201 +0x207 fp=0xc000143fe0 sp=0xc000143f98 pc=0x46d287 runtime.goexit() /usr/local/go/src/runtime/asm_amd64.s:1333 +0x1 fp=0xc000143fe8 sp=0xc000143fe0 pc=0x497e91

goroutine 19 [syscall]: os/signal.signal_recv(0x0) /usr/local/go/src/runtime/sigqueue.go:139 +0x9c os/signal.loop() /usr/local/go/src/os/signal/signal_unix.go:23 +0x22 created by os/signal.init.0 /usr/local/go/src/os/signal/signal_unix.go:29 +0x41

goroutine 34 [chan receive]: engo.io/engo.runLoop.func1(0xc00009e240) /home/r3mb00/GoMobile/src/engo.io/engo/engo_glfw.go:263 +0x34 created by engo.io/engo.runLoop /home/r3mb00/GoMobile/src/engo.io/engo/engo_glfw.go:262 +0x103

goroutine 7 [runnable]: github.com/hajimehoshi/go-mp3/internal/imdct.Win(0xc00013fbb0, 0x12, 0x12, 0x0, 0xc00149ac60, 0x24, 0x24) /home/r3mb00/GoMobile/src/github.com/hajimehoshi/go-mp3/internal/imdct/imdct.go:81 +0x272 github.com/hajimehoshi/go-mp3/internal/frame.(Frame).hybridSynthesis(0xc001484000, 0x1, 0x0) /home/r3mb00/GoMobile/src/github.com/hajimehoshi/go-mp3/internal/frame/frame.go:459 +0xcd github.com/hajimehoshi/go-mp3/internal/frame.(Frame).Decode(0xc001484000, 0xc000092240, 0x4e0e, 0xc00118ca00) /home/r3mb00/GoMobile/src/github.com/hajimehoshi/go-mp3/internal/frame/frame.go:129 +0x1ad github.com/hajimehoshi/go-mp3.(Decoder).readFrame(0xc00009e180, 0x7f7692799440, 0x0) /home/r3mb00/GoMobile/src/github.com/hajimehoshi/go-mp3/decode.go:52 +0x158 github.com/hajimehoshi/go-mp3.(Decoder).Read(0xc00009e180, 0xc001183c00, 0xb7c, 0xb7c, 0x671b40, 0xf4201, 0xc001183c00) /home/r3mb00/GoMobile/src/github.com/hajimehoshi/go-mp3/decode.go:59 +0x3c engo.io/engo/common/internal/decode/mp3.(Stream).Read(0xc00008e310, 0xc001183c00, 0xb7c, 0xb7c, 0xb7c, 0xb7c, 0x0) /home/r3mb00/GoMobile/src/engo.io/engo/common/internal/decode/mp3/decode_notjs.go:26 +0xa8 engo.io/engo/common.(Player).readLoop(0xc00123c000) /home/r3mb00/GoMobile/src/engo.io/engo/common/audio_player.go:162 +0x54b engo.io/engo/common.newPlayer.func1(0xc00123c000) /home/r3mb00/GoMobile/src/engo.io/engo/common/audio_player.go:83 +0x2b created by engo.io/engo/common.newPlayer /home/r3mb00/GoMobile/src/engo.io/engo/common/audio_player.go:82 +0x304

goroutine 23 [runnable]: engo.io/engo/common.(*Player).readLoop(0xc00123c0a0) /home/r3mb00/GoMobile/src/engo.io/engo/common/audio_player.go:130 +0x2e2 engo.io/engo/common.newPlayer.func1(0xc00123c0a0) /home/r3mb00/GoMobile/src/engo.io/engo/common/audio_player.go:83 +0x2b created by engo.io/engo/common.newPlayer /home/r3mb00/GoMobile/src/engo.io/engo/common/audio_player.go:82 +0x304 exit status 2

:(((

Noofbiz commented 5 years ago

Do you have the alsa library installed? Try 'sudo apt install libasound2-dev'

TechComSpot commented 5 years ago

@Noofbiz thank you for helping me. I tried as you said with libasound and terminal said: screenshot at 2018-12-03 06-30-42

Then I tried again with gomobile:

screenshot at 2018-12-03 06-31-19

:( Any suggestions?

Noofbiz commented 5 years ago

Looks like you have more than one version of go installed and it's trying to build both. Try uninstalling and reinstalling go. Just delete usr/local/go and then reinstall go.

TechComSpot commented 5 years ago

@Noofbiz I reinstalled golang from binary installation to the systems installation. Error gone but another one shows up: screenshot at 2018-12-06 03-34-22

Noofbiz commented 5 years ago

I'm not sure. It says there's a file first.go that uses package main. Any file with the package main needs to have the tag //+build !mobilebind followed by a blank line at the top of the file. If you want to use it for Android as well you'll need a separate file with the package hypnic and //+build mobilebind

TechComSpot commented 5 years ago

Hi, @Noofbiz I almost handle all appeared errors but in the end got this: screenshot at 2018-12-09 03-31-23 But in the platform directory I have this: screenshot at 2018-12-09 03-36-09

Noofbiz commented 5 years ago

Did you run 'gomobile init'?

TechComSpot commented 5 years ago

Yeap, just before executing this one.

TechComSpot commented 5 years ago

Hi, @Noofbiz :((Got one more error: screenshot at 2018-12-12 02-41-48