Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
x/mobile/app: all example apps not working on android 4.2.2 #13741
All examples from golang.org/x/mobile doesnt work. I have a log:
I digged around and find, application crashes when call to C.AInputQueue_detachLooper() happened from CGO.
golang.org/x/mobile/example/gobind - works, when i build from console.
UPD: examples works on computer with Linux.
UPD: examples had worked before last updates of gomobile (or go) tool. It woked in go1.5 and gomobile (October or November release).
As far as I can tell, the call to
According to the documentation here http://developer.android.com/ndk/samples/sample_na.html regarding
My best guess is this results in the crash seen on 4.x and the error of trying to detach a looper that was never attached is ignored on 5.x.
If this sounds right to you, then the call to
I noticed this when reviewing HEAD (I just submitted https://go-review.googlesource.com/#/c/20145/) where-as in the referenced commit there was only one call.
What the CL does is only remove the errorneous detach call when the native activity callback is called. The input queue managed in android.go later on already processes any final events and calls detachLooper before proceeding with the new native input queue. So in theory, it shouldn't leak. But for any case I can think of that would leak would also apply to the current code as-is.