Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building go library and Android app - Go module errors #2

Open
zenonasz opened this issue Jan 1, 2025 · 0 comments
Open

Building go library and Android app - Go module errors #2

zenonasz opened this issue Jan 1, 2025 · 0 comments

Comments

@zenonasz
Copy link

zenonasz commented Jan 1, 2025

Hi, first of all, I very much appreciate your efforts. A lot of knowledge and architectural practices and principles have been put into this project.

I know that the project has been inactive for some time (except for some of your libraries on different repos which are still active).
I ended on your repo after researching off-the-grid communications for a similar use case as your initiative to start the project (although I have build meshtastic and reticulum, I am looking for solutions pretty much simal to yours)

I tried to build the project so I started with the go module library "wpgate-aar" which I still haven't successfully build.

I tried your suggestion and use the dockerize gomobile image from https://github.com/mysteriumnetwork/xgomobile .
after many trials and errors, I used the below command executed from root folder of the project:

docker run --rm \
    -v "$PWD"/build:/build \
    -v "$PWD":/go/src \
    -w /go/src \
    -e OUT=Mysterium \
    -e FLAG_V=true \
    -e FLAG_X=true \
    -e FLAG_RACE=true \
    -e FLAG_BUILDMODE=default \
    -e TARGETS=android/. \
    -e GO111MODULE=off \
    mysteriumnetwork/xgomobile:1.13.8 ./android/wpgate-aar

something to notice above is that I mount the root project directory to the default dockerized GOPATH. This is because if I used another directory e.g. ' -v "$PWD":/app ' I was getting build errors and I notice that the image was still trying to fetch './android/wpgate-aar' from the default dockerized GOPATH e.g. '/go/src./android/wpgate-aar'.

Currently the command that I posted is the closest on achieving something but I still get errors.
Here is the output of the docker run command above:


Fetching main repository ./android/wpgate-aar...
github.com/costinm/tungate (download)
github.com/eycorsican/go-tun2socks (download)
github.com/songgao/water (download)
github.com/costinm/ugate (download)
github.com/costinm/meshauth (download)
# cd /go/src/github.com/costinm/meshauth; git submodule update --init --recursive
fatal: No url found for submodule path 'pkg/uk8s' in .gitmodules
package github.com/costinm/meshauth: exit status 128
github.com/costinm/ssh-mesh (download)
package log/slog: unrecognized import path "log/slog" (import path does not begin with hostname)
github.com/pkg/sftp (download)
github.com/kr/fs (download)
get "golang.org/x/crypto/ssh": found meta tag get.metaImport{Prefix:"golang.org/x/crypto", VCS:"git", RepoRoot:"https://go.googlesource.com/crypto"} at //golang.org/x/crypto/ssh?go-get=1
get "golang.org/x/crypto/ssh": verifying non-authoritative meta tag
golang.org/x/crypto (download)
package crypto/ecdh: unrecognized import path "crypto/ecdh" (import path does not begin with hostname)
get "golang.org/x/exp/slog": found meta tag get.metaImport{Prefix:"golang.org/x/exp", VCS:"git", RepoRoot:"https://go.googlesource.com/exp"} at //golang.org/x/exp/slog?go-get=1
get "golang.org/x/exp/slog": verifying non-authoritative meta tag
golang.org/x/exp (download)
package cmp: unrecognized import path "cmp" (import path does not begin with hostname)
package slices: unrecognized import path "slices" (import path does not begin with hostname)
get "golang.org/x/sys/unix": found meta tag get.metaImport{Prefix:"golang.org/x/sys", VCS:"git", RepoRoot:"https://go.googlesource.com/sys"} at //golang.org/x/sys/unix?go-get=1
get "golang.org/x/sys/unix": verifying non-authoritative meta tag
golang.org/x/sys (download)
package golang.org/x/sys/unix: found packages unix (affinity_linux.go) and main (mkasm.go) in /go/src/golang.org/x/sys/unix
package github.com/costinm/ugate/dns: cannot find package "github.com/costinm/ugate/dns" in any of:
	/usr/local/go/src/github.com/costinm/ugate/dns (from $GOROOT)
	/go/src/github.com/costinm/ugate/dns (from $GOPATH)
	/go/src/android/wpgate-aar/Godeps/_workspace/src/github.com/costinm/ugate/dns
	/go/src/android/Godeps/_workspace/src/github.com/costinm/ugate/dns
get "golang.org/x/net/ipv4": found meta tag get.metaImport{Prefix:"golang.org/x/net", VCS:"git", RepoRoot:"https://go.googlesource.com/net"} at //golang.org/x/net/ipv4?go-get=1
get "golang.org/x/net/ipv4": verifying non-authoritative meta tag
golang.org/x/net (download)
package golang.org/x/net/ipv4: found packages ipv4 (batch.go) and main (gen.go) in /go/src/golang.org/x/net/ipv4
package github.com/costinm/ugate/pkg/ugatesvc: cannot find package "github.com/costinm/ugate/pkg/ugatesvc" in any of:
	/usr/local/go/src/github.com/costinm/ugate/pkg/ugatesvc (from $GOROOT)
	/go/src/github.com/costinm/ugate/pkg/ugatesvc (from $GOPATH)
	/go/src/android/wpgate-aar/Godeps/_workspace/src/github.com/costinm/ugate/pkg/ugatesvc
	/go/src/android/Godeps/_workspace/src/github.com/costinm/ugate/pkg/ugatesvc
GOMOBILE=/go/pkg/gomobile
WORK=/tmp/gomobile-work-731761440
GOOS=android CGO_ENABLED=1 /usr/bin/gobind -lang=go,java -outdir=$WORK android/wpgate-aar
type-checking package "android/wpgate-aar" failed (/go/src/android/wpgate-aar/tungate_wrapper.go:17:2: could not import github.com/costinm/ugate (type-checking package "github.com/costinm/ugate" failed (/go/src/github.com/costinm/ugate/mesh.go:9:2: could not import github.com/costinm/meshauth (/go/src/github.com/costinm/meshauth/meshauth.go:117:13: expected '(', found '['))))

rm -r -f "$WORK"
gomobile: /usr/bin/gobind -lang=go,java -outdir=/tmp/gomobile-work-731761440 android/wpgate-aar failed: exit status 1

any suggestions?
do I follow the right direction?

Again thanks for your effort and I hope you see this post :)

P.S Happy new year

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant