Skip to content

x/mobile: gomobile bind does not support vendor #34181

Open
@Student414

Description

@Student414

What version of Go are you using (go version)?

go version go1.13 windows/amd64

Does this issue reproduce with the latest release?

What operating system and processor architecture are you using (go env)?

go env Output
set GO111MODULE=auto
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Wang\AppData\Local\go-build
set GOENV=C:\Users\Wang\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=D:\Work\go\gopath
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=D:\Work\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=D:\Work\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=D:\Work\go\gopath\src\github.com\fatedier\frp\go.mod
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\Wang\AppData\Local\Temp\go-build704107050=/tmp/go-build -gno-record-gcc-switches

What did you do?

  • go get github.com/fatedier/frp
  • vi {GOPATH}/github.com/fatedier/frp/cmd/frpc/sub/export.go
package sub

import (
	"time"
	"math/rand"

	_ "github.com/fatedier/frp/assets/frpc/statik"
	
	"github.com/fatedier/golib/crypto"
)
// I want to export this function only
func Start(filePath string) {
	crypto.DefaultSalt = "frp"
	rand.Seed(time.Now().UnixNano())

	runClient(filePath)
}

open terminal
gomobile bind -target android github.com/fatedier/frp/cmd/frpc/sub

What did you expect to see?

gomobile create a .aar and .jar file

What did you see instead?

gomobile: D:\Work\go\gopath\bin\gobind.exe -lang=go,java -outdir=C:\Users\Wang\AppData\Local\Temp\gomobile-work-225577183 github.com/fatedier/frp/cmd/frpc/sub failed: exit status 1
type-checking package "github.com/fatedier/frp/cmd/frpc/sub" failed (D:\Work\go\gopath\src\github.com\fatedier\frp\cmd\frpc\sub\http.go:22:2: could not import github.com/spf13/cobra (type-checking package "github.com/spf13/cobra" failed (D:\Work\go\gopath\pkg\mod\github.com\spf13\cobra@v0.0.3\bash_completions.go:11:2: could not import github.com/spf13/pflag (cannot find package "github.com/spf13/pflag" in any of:
        D:\Work\go\src\github.com\spf13\pflag (from $GOROOT)
        D:\Work\go\gopath\src\github.com\spf13\pflag (from $GOPATH)))))

Metadata

Metadata

Assignees

No one assigned

    Labels

    NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.mobileAndroid, iOS, and x/mobile

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions