Closed athulantonynp closed 5 months ago
Android builds aren't officially supported, although if there any fixes / changes to support that are simple enough we're happy to take them (this particular issue doesn't seem particularly actionable). Looking at what gomobile-ipfs is doing or leveraging the underlying libraries from boxo seems like the best bet.
You may have better luck asking on the forums http://discuss.ipfs.tech/ or chat channels https://docs.ipfs.tech/community/#chat.
I've encountered this as well, how do I solve this problem?
The same issue happened here on Android.
core/builder.go:158 constructing the node: could not build arguments for function "reflect".makeFuncStub (/Users/mingfeng/sdk/go1.23.0/src/reflect/asm_arm64.s:29): failed to build pin.Pinner: could not build arguments for function "github.com/ipfs/kubo/core/node".Pinning (/Users/mingfeng/go/pkg/mod/github.com/ipfs/kubo@v0.29.0/core/node/core.go:45): failed to build format.DAGService: could not build arguments for function "github.com/ipfs/kubo/core/node".Dag (/Users/mingfeng/go/pkg/mod/github.com/ipfs/kubo@v0.29.0/core/node/core.go:144): failed to build blockservice.BlockService: could not build arguments for function "github.com/ipfs-shipyard/nopfs/ipfs".WrapBlockService (/Users/mingfeng/go/pkg/mod/github.com/ipfs-shipyard/nopfs/ipfs@v0.13.2-0.20231027223058-cde3b5ba964c/blockservice.go:24): failed to build *nopfs.Blocker: received non-nil error from function "github.com/ipfs/kubo/plugin/plugins/nopfs".MakeBlocker (/Users/mingfeng/go/pkg/mod/github.com/ipfs/kubo@v0.29.0/plugin/plugins/nopfs/nopfs.go:40): exec: "getent": executable file not found in $PATH
Checklist
Installation method
third-party binary
Version
No response
Config
No response
Description
Disclaimer: I am fairly new to Golang and IPFS world. I am trying to run kubo with the help of gomobile in an Android app. The process of creating a node is failing with long error saying
What i understood from the error is that the ipfs core package is trying to access
GETENT
program from the underlying linux arch which is restricted on non-rooted devices. But i am struggling to solve this.I have created a minimal reproducible example in this repo https://github.com/athulantonynp/ipfs-android-golang with the build instructions.
Also here is my
go env
output.Any leads to solve this issue appreciated.
PS: I have seen some other repos like https://github.com/ipfs-shipyard/gomobile-ipfs and it is working fine even though their approach to create the nodes are similar except the Golang & Kubo versions are bit old compared to what i have used. I guess it shouldn't be a problem.