Open rohankeskar19 opened 4 years ago
@hajimehoshi
I could not reproduce this on macOS, but I encountered a different error:
whisperv6_android.c:503:78: error: redefinition of parameter 'env'
whisperv6_android.c:503:47: note: previous declaration is here
whisperv6_android.c:503:78: error: parameter name omitted
whisperv6_android.c:1410:94: error: redefinition of parameter 'env'
whisperv6_android.c:1410:63: note: previous declaration is here
whisperv6_android.c:1410:94: error: parameter name omitted
whisperv6_android.c:1417:10: error: redefinition of 'env' with a different type: 'JNIEnv *' (aka 'const struct JNINativeInterface **') vs 'int32_t' (aka 'int')
whisperv6_android.c:1416:65: note: previous definition is here
whisperv6_android.c:1418:33: error: incompatible integer to pointer conversion passing 'int32_t' (aka 'int') to parameter of type 'JNIEnv *' (aka 'const struct JNINativeInterface **') [-Werror,-Wint-conversion]
gobind/seq_android.h:42:43: note: passing argument to parameter 'env' here
whisperv6_android.c:1419:36: error: incompatible integer to pointer conversion passing 'int32_t' (aka 'int') to parameter of type 'JNIEnv *' (aka 'const struct JNINativeInterface **') [-Werror,-Wint-conversion]
gobind/seq_android.h:42:43: note: passing argument to parameter 'env' here
whisperv6_android.c:1420:3: error: indirection requires pointer operand ('int32_t' (aka 'int') invalid)
whisperv6_android.c:1421:25: error: incompatible integer to pointer conversion passing 'int32_t' (aka 'int') to parameter of type 'JNIEnv *' (aka 'const struct JNINativeInterface **') [-Werror,-Wint-conversion]
gobind/seq_android.h:59:44: note: passing argument to parameter 'env' here
gomobile: go build -v -buildmode=c-shared -o=/var/folders/ht/ky_bwgzs4bd5z1hh02k34x_h0000gn/T/gomobile-work-754074888/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind failed: exit status 2
C:\Users\rohan\AppData\Local\Android\Sdk\ndk-bundle\toolchains\llvm\prebuilt\windows-x86_64\bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin\ld: fatal error: $WORK\b191_cgo_.o: open: Invalid argument
~My guess is that this error complains that filepath mixes '\' and '/'.~
EDIT: NVM, I think the path should work...
@rohankeskar19 Did the old gomobile (e.g., 597adff16ade9d88626f8caea514bb189b8c74ee) worked? Of course this doesn't accept Go modules, but I was wondering if old gomobile worked with GO111MODULE=off.
@hajimehoshi I don't know what you are asking, But I will try if you will tell me what to do...
I assumed you were trying to test this with the latest gomobile (Git hash: 82c397c4c5279f331dce14d734fda7060e4a3691), but is that correct? If not, could you tell me the version of gomobile? gomobile version
should show this.
And, I'd like you to try to change gomobile version if possible.
I assumed you were trying to test this with the latest gomobile (Git hash: 82c397c4c5279f331dce14d734fda7060e4a3691), but is that correct? If not, could you tell me the version of gomobile?
gomobile version
should show this.And, I'd like you to try to change gomobile version if possible.
gomobile version +82c397c Thu Jan 23 02:49:42 2020 +0000 (android); androidSDK=C:\Users\rohan\AppData\Local\Android\Sdk\platforms\android-29
I assumed you were trying to test this with the latest gomobile (Git hash: 82c397c4c5279f331dce14d734fda7060e4a3691), but is that correct? If not, could you tell me the version of gomobile?
gomobile version
should show this. And, I'd like you to try to change gomobile version if possible.gomobile version +82c397c Thu Jan 23 02:49:42 2020 +0000 (android); androidSDK=C:\Users\rohan\AppData\Local\Android\Sdk\platforms\android-29
How can I install the version you are specifying??
Thank you! Looks like you are using the latest one.
You can install old versions by git-cloning:
git clone https://go.googlesource.com/mobile
cd mobile
git checkout 597adff16ade9d88626f8caea514bb189b8c74ee
go install ./cmd/...
Note that old gomobile cannot use Go modules, then you need to go-get libraries with GO111MODULE=off
.
Thank you! Looks like you are using the latest one.
You can install old versions by git-cloning:
git clone https://go.googlesource.com/mobile cd mobile git checkout 597adff16ade9d88626f8caea514bb189b8c74ee go install ./cmd/...
Note that old gomobile cannot use Go modules, then you need to go-get libraries with
GO111MODULE=off
.
Hi, can you please tell me with how can I do what you are telling me to do in the note
I think you can do it on your command prompt at any directory.
(If you don't have git, please install it https://git-scm.com/downloads)
Oops, I'm sorry, as old gomobile doesn't use Go modules, you need to install gomobile in $GOPATH. Then instead of cloning by you self, please go-get with GO111MODULE=off.
set GO111MODULE=off
go get -u golang.org/x/mobile
cd C:\Users\rohan\go\src\golang.org\x\gomobile
git checkout 597adff16ade9d88626f8caea514bb189b8c74ee
go install ./cmd/...
Oops, I'm sorry, as old gomobile doesn't use Go modules, you need to install gomobile in $GOPATH. Then instead of cloning by you self, please go-get with GO111MODULE=off.
set GO111MODULE=off go get -u golang.org/x/mobile cd C:\Users\rohan\go\src\golang.org\x\gomobile git checkout 597adff16ade9d88626f8caea514bb189b8c74ee go install ./cmd/...
I'm getting this
C:\Users\rohan\go\src\golang.org\x\mobile (HEAD detached at 597adff) λ go install ./cmd/... internal\importers\java\java.go:14:2: cannot find package "bufio" in any of: C:\Go\bin\src\bufio (from $GOROOT) C:\Users\rohan\go\src\bufio (from $GOPATH) cmd\gobind\gen.go:8:2: cannot find package "bytes" in any of: C:\Go\bin\src\bytes (from $GOROOT) C:\Users\rohan\go\src\bytes (from $GOPATH) internal\importers\ast.go:29:2: cannot find package "errors" in any of: C:\Go\bin\src\errors (from $GOROOT) C:\Users\rohan\go\src\errors (from $GOPATH) cmd\gobind\main.go:9:2: cannot find package "flag" in any of: C:\Go\bin\src\flag (from $GOROOT) C:\Users\rohan\go\src\flag (from $GOPATH) cmd\gobind\gen.go:9:2: cannot find package "fmt" in any of: C:\Go\bin\src\fmt (from $GOROOT) C:\Users\rohan\go\src\fmt (from $GOPATH) cmd\gobind\gen.go:10:2: cannot find package "go/ast" in any of: C:\Go\bin\src\go\ast (from $GOROOT) C:\Users\rohan\go\src\go\ast (from $GOPATH) cmd\gobind\gen.go:11:2: cannot find package "go/build" in any of: C:\Go\bin\src\go\build (from $GOROOT) C:\Users\rohan\go\src\go\build (from $GOPATH) bind\genjava.go:9:2: cannot find package "go/constant" in any of: C:\Go\bin\src\go\constant (from $GOROOT) C:\Users\rohan\go\src\go\constant (from $GOPATH) bind\bind.go:17:2: cannot find package "go/format" in any of: C:\Go\bin\src\go\format (from $GOROOT) C:\Users\rohan\go\src\go\format (from $GOPATH) cmd\gobind\main.go:13:2: cannot find package "go/importer" in any of: C:\Go\bin\src\go\importer (from $GOROOT) C:\Users\rohan\go\src\go\importer (from $GOPATH) cmd\gobind\main.go:14:2: cannot find package "go/parser" in any of: C:\Go\bin\src\go\parser (from $GOROOT) C:\Users\rohan\go\src\go\parser (from $GOPATH) cmd\gobind\gen.go:12:2: cannot find package "go/token" in any of: C:\Go\bin\src\go\token (from $GOROOT) C:\Users\rohan\go\src\go\token (from $GOPATH) cmd\gobind\gen.go:13:2: cannot find package "go/types" in any of: C:\Go\bin\src\go\types (from $GOROOT) C:\Users\rohan\go\src\go\types (from $GOPATH) bind\genjava.go:11:2: cannot find package "html" in any of: C:\Go\bin\src\html (from $GOROOT) C:\Users\rohan\go\src\html (from $GOPATH) bind\bind.go:20:2: cannot find package "io" in any of: C:\Go\bin\src\io (from $GOROOT) C:\Users\rohan\go\src\io (from $GOPATH) cmd\gobind\gen.go:15:2: cannot find package "io/ioutil" in any of: C:\Go\bin\src\io\ioutil (from $GOROOT) C:\Users\rohan\go\src\io\ioutil (from $GOPATH) bind\types.go:10:2: cannot find package "log" in any of: C:\Go\bin\src\log (from $GOROOT) C:\Users\rohan\go\src\log (from $GOPATH) bind\genjava.go:12:2: cannot find package "math" in any of: C:\Go\bin\src\math (from $GOROOT) C:\Users\rohan\go\src\math (from $GOPATH) cmd\gobind\gen.go:16:2: cannot find package "os" in any of: C:\Go\bin\src\os (from $GOROOT) C:\Users\rohan\go\src\os (from $GOPATH) internal\importers\java\java.go:18:2: cannot find package "os/exec" in any of: C:\Go\bin\src\os\exec (from $GOROOT) C:\Users\rohan\go\src\os\exec (from $GOPATH) internal\importers\ast.go:34:2: cannot find package "path" in any of: C:\Go\bin\src\path (from $GOROOT) C:\Users\rohan\go\src\path (from $GOPATH) internal\importers\ast.go:35:2: cannot find package "path/filepath" in any of: C:\Go\bin\src\path\filepath (from $GOROOT) C:\Users\rohan\go\src\path\filepath (from $GOPATH) internal\importers\java\java.go:19:2: cannot find package "reflect" in any of: C:\Go\bin\src\reflect (from $GOROOT) C:\Users\rohan\go\src\reflect (from $GOPATH) bind\gen.go:14:2: cannot find package "regexp" in any of: C:\Go\bin\src\regexp (from $GOROOT) C:\Users\rohan\go\src\regexp (from $GOPATH) package golang.org/x/mobile/cmd/gobind imports runtime: cannot find package "runtime" in any of: C:\Go\bin\src\runtime (from $GOROOT) C:\Users\rohan\go\src\runtime (from $GOPATH) internal\importers\ast.go:36:2: cannot find package "sort" in any of: C:\Go\bin\src\sort (from $GOROOT) C:\Users\rohan\go\src\sort (from $GOPATH) internal\importers\ast.go:37:2: cannot find package "strconv" in any of: C:\Go\bin\src\strconv (from $GOROOT) C:\Users\rohan\go\src\strconv (from $GOPATH) internal\importers\ast.go:38:2: cannot find package "strings" in any of: C:\Go\bin\src\strings (from $GOROOT) C:\Users\rohan\go\src\strings (from $GOPATH) internal\importers\java\java.go:21:2: cannot find package "unicode" in any of: C:\Go\bin\src\unicode (from $GOROOT) C:\Users\rohan\go\src\unicode (from $GOPATH) internal\importers\java\java.go:22:2: cannot find package "unicode/utf8" in any of: C:\Go\bin\src\unicode\utf8 (from $GOROOT) C:\Users\rohan\go\src\unicode\utf8 (from $GOPATH) cmd\gomobile\bind_androidapp.go:8:2: cannot find package "archive/zip" in any of: C:\Go\bin\src\archive\zip (from $GOROOT) C:\Users\rohan\go\src\archive\zip (from $GOPATH) internal\binres\sdk.go:6:2: cannot find package "compress/gzip" in any of: C:\Go\bin\src\compress\gzip (from $GOROOT) C:\Users\rohan\go\src\compress\gzip (from $GOPATH) cmd\gomobile\cert.go:8:2: cannot find package "crypto" in any of: C:\Go\bin\src\crypto (from $GOROOT) C:\Users\rohan\go\src\crypto (from $GOPATH) cmd\gomobile\writer.go:70:2: cannot find package "crypto/rand" in any of: C:\Go\bin\src\crypto\rand (from $GOROOT) C:\Users\rohan\go\src\crypto\rand (from $GOPATH) cmd\gomobile\cert.go:9:2: cannot find package "crypto/rsa" in any of: C:\Go\bin\src\crypto\rsa (from $GOROOT) C:\Users\rohan\go\src\crypto\rsa (from $GOPATH) cmd\gomobile\cert.go:10:2: cannot find package "crypto/sha1" in any of: C:\Go\bin\src\crypto\sha1 (from $GOROOT) C:\Users\rohan\go\src\crypto\sha1 (from $GOPATH) cmd\gomobile\build_androidapp.go:9:2: cannot find package "crypto/x509" in any of: C:\Go\bin\src\crypto\x509 (from $GOROOT) C:\Users\rohan\go\src\crypto\x509 (from $GOPATH) cmd\gomobile\cert.go:12:2: cannot find package "crypto/x509/pkix" in any of: C:\Go\bin\src\crypto\x509\pkix (from $GOROOT) C:\Users\rohan\go\src\crypto\x509\pkix (from $GOPATH) internal\binres\binres.go:49:2: cannot find package "encoding" in any of: C:\Go\bin\src\encoding (from $GOROOT) C:\Users\rohan\go\src\encoding (from $GOPATH) cmd\gomobile\cert.go:13:2: cannot find package "encoding/asn1" in any of: C:\Go\bin\src\encoding\asn1 (from $GOROOT) C:\Users\rohan\go\src\encoding\asn1 (from $GOPATH) cmd\gomobile\build_androidapp.go:10:2: cannot find package "encoding/base64" in any of: C:\Go\bin\src\encoding\base64 (from $GOROOT) C:\Users\rohan\go\src\encoding\base64 (from $GOPATH) internal\binres\binres.go:50:2: cannot find package "encoding/binary" in any of: C:\Go\bin\src\encoding\binary (from $GOROOT) C:\Users\rohan\go\src\encoding\binary (from $GOPATH) cmd\gomobile\build_androidapp.go:11:2: cannot find package "encoding/pem" in any of: C:\Go\bin\src\encoding\pem (from $GOROOT) C:\Users\rohan\go\src\encoding\pem (from $GOPATH) cmd\gomobile\binary_xml.go:8:2: cannot find package "encoding/xml" in any of: C:\Go\bin\src\encoding\xml (from $GOROOT) C:\Users\rohan\go\src\encoding\xml (from $GOPATH) cmd\gomobile\writer.go:75:2: cannot find package "hash" in any of: C:\Go\bin\src\hash (from $GOROOT) C:\Users\rohan\go\src\hash (from $GOPATH) cmd\gomobile\main.go:15:2: cannot find package "html/template" in any of: C:\Go\bin\src\html\template (from $GOROOT) C:\Users\rohan\go\src\html\template (from $GOPATH) cmd\gomobile\cert.go:15:2: cannot find package "math/big" in any of: C:\Go\bin\src\math\big (from $GOROOT) C:\Users\rohan\go\src\math\big (from $GOPATH) cmd\gomobile\bind_iosapp.go:14:2: cannot find package "text/template" in any of: C:\Go\bin\src\text\template (from $GOROOT) C:\Users\rohan\go\src\text\template (from $GOPATH) cmd\gomobile\cert.go:16:2: cannot find package "time" in any of: C:\Go\bin\src\time (from $GOROOT) C:\Users\rohan\go\src\time (from $GOPATH) internal\binres\pool.go:9:2: cannot find package "unicode/utf16" in any of: C:\Go\bin\src\unicode\utf16 (from $GOROOT) C:\Users\rohan\go\src\unicode\utf16 (from $GOPATH)
That's odd... This seems loading standard libraries failed. @hyangah do you have any insights?
With both 82c397...
and 597adf...
I'm getting identical results as https://github.com/golang/go/issues/36731#issuecomment-578124552 on windows.
Reguarding the last post from @rohankeskar19, notice how the path says C:\Go\bin\src...
and not C:\Go\src
this looks like a system configuration issue or a bad Go install.
With both 82c397... and 597adf... I'm getting identical results as #36731 (comment) on windows.
Thank you! This means that this issue has existed even before introducing Go modules.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
What did you expect to see?
I want to generate android library from the go library
What did you see instead?