Skip to content

x/mobile: gradle plugin fails on Mac due to -i flag trying to change /usr/local #25076

Closed
@i9

Description

@i9

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

go version go1.10.1 darwin/amd64

Does this issue reproduce with the latest release?

Yes

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

darwin amd64

What did you do?

add gradle plugin to Android studio project and try to build

What did you expect to see?

.aar built by gomobile

What did you see instead?

build failed.
go build runtime/cgo: mkdir /usr/local/go/pkg/android_arm_shared: permission denied
/Users/junda/go/bin/gomobile: go build -v -i -buildmode=c-shared -o=/var/folders/.../android/src/main/jniLibs/armeabi-v7a/libgojni.so gobind failed: exit status 1

Running gomobile without -i works without issue.
Also in 1.10 release note https://golang.org/doc/go1.10:
"The old advice to add the -i flag for speed, as in go build -i or go test -i, is no longer necessary: builds run just as fast without -i. For more details, see gohelp cache."

Proposal

https://go-review.googlesource.com/c/mobile/+/109144 to remove the -i flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions