Android packaging fails: could not determine kind of name for C.ALooper_pollAll
TimidFuzz opened this issue · comments
Checklist
- I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
- This issue only relates to a single bug. I will open new issues for any other problems.
Describe the bug
Command: fyne package -os android -appID com.example.test
Output:
go build -buildmode=c-shared -o /tmp/fyne-work-1596608702/lib/armeabi-v7a/libtest.so test failed: exit status 1
# fyne.io/fyne/v2/internal/driver/mobile/app
../../go/pkg/mod/fyne.io/fyne/v2@v2.4.5/internal/driver/mobile/app/android.go:520:6: could not determine kind of name for C.ALooper_pollAll
How to reproduce
- Install android ndk
- Copy the code & install fyne
- Export the environment variable
export ANDROID_NDK_HOME=~/Android/Sdk/ndk/27.0.11718014/
- Package for android using
fyne package -os android -appID com.example.test
Screenshots
No response
Example code
package main
import (
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("test")
content := widget.NewLabel("Hello world!")
w.SetContent(content)
w.ShowAndRun()
}
Fyne version
v2.4.5
Go compiler version
1.22.0
Operating system and version
Manjaro linux
Additional Information
This seems to affect only the latest versions of the ndk. Using r20b fixes the issue.
I faced the same problem and have not found the solution yet, but it seems that C.ALooper_pollAll
was deleted in android api 34 as stated here.
I solved it by going to the error (
fyne/internal/driver/mobile/app/android.go
Line 520 in d8e9fe0
Hello. I was able to solve this issue replacing the C.ALooper_pollAll()
with C.ALooper_pollOnce
where the error was called at ../../go/pkg/mod/fyne.io/fyne/v2@v2.4.5/internal/driver/mobile/app/android.go:520:6:
I found the solution here https://developer.android.com/ndk/reference/group/looper
I hope this helps
Suggested fix resolves the issue
I landed that change on to develop thanks for the tip