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

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

Open
Student414 opened this issue Sep 9, 2019 · 0 comments

Comments

@Student414
Copy link

commented Sep 9, 2019

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)))))

@Student414 Student414 changed the title mobile: gomobile bind mobile: gomobile bind cannot support vendor Sep 9, 2019

@smasher164 smasher164 changed the title mobile: gomobile bind cannot support vendor x/mobile: gomobile bind does not support vendor Sep 9, 2019

@gopherbot gopherbot added this to the Unreleased milestone Sep 9, 2019

@gopherbot gopherbot added the mobile label Sep 9, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.