pactus-project / pactus

Pactus blockchain
https://pactus.org
MIT License
198 stars 139 forks source link

Unable to build on Android #1506

Open b00f opened 3 weeks ago

b00f commented 3 weeks ago

By upgrading Pactus to Go 1.23.x, we are no longer able to build Pactus for Android. The error we encounter is:

undefined: anet.Interfaces

After searching the internet, I found this issue mentioned here: https://github.com/wlynxg/anet/blob/main/README.md#how-to-build-with-go-1230-or-later. Unfortunately, this solution didn’t work, and I still received the same error.

To build Pactus for Android, you can run this command:

CGO_ENABLED=0 GOOS=android GOARCH=arm64 go build -ldflags "-s -w" -trimpath -o ./build/android/pactus-daemon ./cmd/daemon
Ja7ad commented 1 week ago

Currently anet package fixed issue on v0.0.5: https://github.com/wlynxg/anet/issues/7

Ja7ad commented 1 week ago

Parent package upgraded it to latest version.

https://github.com/pion/transport/blob/538047e56b04b46dce5388536827b350054f8c9f/go.mod#L1-L11

Ja7ad commented 1 week ago

Issue is tracking for fix in: https://github.com/libp2p/go-libp2p/issues/2997