Error when building for Android (/anytype-heart/space/mock_space missing)
SamBouwer opened this issue · comments
SamBouwer commented
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
- Install dependencies for building Android middleware libraries
- Create heart.yml network config file
- Build using
make build-android
with ANY_SYNC_NETWORK argument pointing at your heart.yml network config file - Build starts, but returns with an error
Expected behavior
The build to succeed.
Desktop (please complete the following information):
- OS: Ubuntu 22.04.2 LTS
- Version: latest main branch of anytype-heart repo as of 28-07-2023
Additional context
I though it might be related to the two lines that are commented out in services.go
:
- https://github.com/anyproto/anytype-heart/blob/main/space/service.go#L56
- https://github.com/anyproto/anytype-heart/blob/main/space/service.go#L57
But uncommenting those lines and building results in the same error.
Full logs:
bouwers@dockervm:~/anytype-heart$ make build-android ANY_SYNC_NETWORK=../any-docker/heart.yml
Using Any Sync Network configuration at ../any-docker/heart.yml
Setting up go modules...
go build -o deps golang.org/x/mobile/cmd/gomobile
go build -o deps golang.org/x/mobile/cmd/gobind
gomobile init
Building library for Android...
gomobile bind -tags "nogrpcserver gomobile nowatchdog nosigar envnetworkcustom" -ldflags "-X github.com/anyproto/anytype-heart/util/vcs.BuildDate=2023-07-28T19:46:49Z -X github.com/anyproto/anytype-heart/util/vcs.GitCommit=430b29b98 -X github.com/anyproto/anytype-heart/util/vcs.GitBranch=github.com/anyproto/anytype-heart/util/vcs -X github.com/anyproto/anytype-heart/util/vcs.GitState=clean -X github.com/anyproto/anytype-heart/util/vcs.GitSummary=v0.27.14-91-g430b29b98" -v -target=android -androidapi 19 -o lib.aar github.com/anyproto/anytype-heart/clientlibrary/service github.com/anyproto/anytype-heart/core
write /tmp/gomobile-work-1186643250/src-android-amd64/go.mod
write /tmp/gomobile-work-1186643250/src-android-arm64/go.mod
write /tmp/gomobile-work-1186643250/src-android-arm/go.mod
write /tmp/gomobile-work-1186643250/src-android-386/go.mod
go: found github.com/anyproto/anytype-heart/clientlibrary/service in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: found github.com/anyproto/anytype-heart/core in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: found github.com/anyproto/anytype-heart/clientlibrary/service in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: found github.com/anyproto/anytype-heart/core in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: found github.com/anyproto/anytype-heart/clientlibrary/service in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: found github.com/anyproto/anytype-heart/core in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: found github.com/anyproto/anytype-heart/clientlibrary/service in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: found github.com/anyproto/anytype-heart/core in github.com/anyproto/anytype-heart v0.0.0-00010101000000-000000000000
go: finding module for package github.com/anyproto/anytype-heart/space/mock_space
go: finding module for package github.com/anyproto/anytype-heart/space/mock_space
go: finding module for package github.com/anyproto/anytype-heart/space/mock_space
go: finding module for package github.com/anyproto/anytype-heart/space/mock_space
gobind/gobind imports
github.com/anyproto/anytype-heart/core imports
github.com/anyproto/anytype-heart/core/anytype imports
github.com/anyproto/anytype-heart/core/filestorage/filesync tested by
github.com/anyproto/anytype-heart/core/filestorage/filesync.test imports
github.com/anyproto/anytype-heart/space/mock_space: module github.com/anyproto/anytype-heart@latest found (v0.27.15, replaced by /home/bouwers/anytype-heart), but does not contain package github.com/anyproto/anytype-heart/space/mock_space
gobind/gobind imports
github.com/anyproto/anytype-heart/core imports
github.com/anyproto/anytype-heart/core/anytype imports
github.com/anyproto/anytype-heart/core/filestorage/filesync tested by
github.com/anyproto/anytype-heart/core/filestorage/filesync.test imports
github.com/anyproto/anytype-heart/space/mock_space: module github.com/anyproto/anytype-heart@latest found (v0.27.15, replaced by /home/bouwers/anytype-heart), but does not contain package github.com/anyproto/anytype-heart/space/mock_space
gobind/gobind imports
github.com/anyproto/anytype-heart/core imports
github.com/anyproto/anytype-heart/core/anytype imports
github.com/anyproto/anytype-heart/core/filestorage/filesync tested by
github.com/anyproto/anytype-heart/core/filestorage/filesync.test imports
github.com/anyproto/anytype-heart/space/mock_space: module github.com/anyproto/anytype-heart@latest found (v0.27.15, replaced by /home/bouwers/anytype-heart), but does not contain package github.com/anyproto/anytype-heart/space/mock_space
gobind/gobind imports
github.com/anyproto/anytype-heart/core imports
github.com/anyproto/anytype-heart/core/anytype imports
github.com/anyproto/anytype-heart/core/filestorage/filesync tested by
github.com/anyproto/anytype-heart/core/filestorage/filesync.test imports
github.com/anyproto/anytype-heart/space/mock_space: module github.com/anyproto/anytype-heart@latest found (v0.27.15, replaced by /home/bouwers/anytype-heart), but does not contain package github.com/anyproto/anytype-heart/space/mock_space
gomobile: go mod tidy -v failed: exit status 1
make: *** [Makefile:131: build-android] Error 1
Mikhail commented
It is very strange behaviour when gomobile tries to rely on test packages. Cannot replicate with a small repository - all is working perfectly.
Quick workaround is to execute make test-deps
just before trying to build mobile versions