Questions tagged [gomobile]

Gomobile is an experimental toolset for using Go on iOS and Android. Gomobile can be used to create entire apps, or as a library to be used by native code.

GoMobile is an experimental toolset, that enables Go/Golang code to run on Android and iOS devices.

94 questions
2
votes
1 answer

How to use gomobile to release output non debug apk?

So I am running gomobile build -target android -o someapk.apk github.com/user.project And keep getting debug apks, is there any way for me to get a production apk. Initially I was working with https://github.com/hajimehoshi/ebiten and trying to…
GrandFleet
  • 809
  • 2
  • 10
  • 25
2
votes
2 answers

Cannot import AAR from golang into my app (tried previous answers but they do not work)

I am trying to make a golang package that can be included in an Android app. So I have created a golang module and built it using go bind to an aar used 'new module' in Android Studio to import the aar gone to project structure/dependencies/...…
Martin Ellison
  • 1,043
  • 1
  • 13
  • 25
2
votes
1 answer

gomobile: binding callbacks for ObjC

I have a Go interface type GetResponse interface { OnResult(json string) } I have to subscribe on that event OnResult from ObjC using this interface. func Subscribe( response GetResponse){ response.OnResult("some json") } ObjC bind gives me a…
ensoreus
  • 21
  • 2
2
votes
1 answer

Gomobile bind producing library with "PIE disabled" / i386 arch

I've used the gomobile bind tool to build my Go library for use in an iOS app. I've wrapped my library into a Cocoapods .podspec. It works nicely in the simulator (via a local development pod), but when I try to do pod lib lint (part step, part of…
Matti
  • 427
  • 1
  • 4
  • 13
2
votes
1 answer

x/mobile/app Can't be compiled for iOS

What version of Go are you using (go version)? go version go1.9 darwin/amd64 XCode Version 9.0 (9A235) What operating system and processor architecture are you using (go…
2
votes
0 answers

How to build for ARMv5 with Gomobile?

I am trying to replace an existing Go build with Gomobile. However, it seems there is no way to compile for ARMv5 with Gomobile. The old build is doing something like this: export GOARCH=arm export GOARM=5 go build…
user1837158
2
votes
1 answer

gomobile init fails to find stdlib.h

I'm trying to make a cross-platform native library using go and found this tutorial for gomobile. However, when I try to initialize it (even if I give the Android NDK path although I don't in the example below) it seems to fail because it can't find…
jm0
  • 3,294
  • 2
  • 16
  • 18
2
votes
2 answers

How can I install go mobile and have it work on windows?

I am having issues installing gomobile on windows with the command : go get golang.org/x/mobile/cmd/gomobile It doesn't give me any error but it doesn't seem to be doing anything. When trying to execute gomobile afterwards I get the error:…
Traoré Moussa
  • 433
  • 1
  • 6
  • 22
2
votes
0 answers

Write to Keychain/SharedPreferences with GoMobile

I am looking to write to keychain(iOS)/sharedprefs(Android) from GoMobile. Does anyone have any experience or packages to support this? My preference is to avoid writing the custom integration as I assume it would be fairly common…
Steve
  • 469
  • 4
  • 12
2
votes
1 answer

Golang: Gomobile app cannot generate files

Does anyone use gomobile app before and have successfully create files in phones? I tried the following code on Galaxy S4 with Android 4.4.2: package main import ( "golang.org/x/mobile/app" "golang.org/x/mobile/event/lifecycle" …
Kyle
  • 831
  • 1
  • 9
  • 17
2
votes
2 answers

Evaluate nil values from gomobile bind

What's the right way to evaluate nil returned values from Go functions in Android Java? Here's what I've tried: // ExportedGoFunction returns a pointer to a GoStruct or nil in case of fail func ExportedGoFunction() *GoStruct { return nil } Then…
Bruno Vieira
  • 3,884
  • 1
  • 23
  • 35
1
vote
0 answers

gomobile: error return values on iOS have both NSError and boolean return

When using gobind via gomobile on iOS for an interface type, a golang function returning an error results in 2 impacts to the class in Objective C (example below): The inclusion of a NSError pointer passed in The method returns a boolean I can…
scosman
  • 2,343
  • 18
  • 34
1
vote
0 answers

How to get packageName from gomobile in android

How to JNICall from gomobile in android I want to write part of the code of my Android application in the Go library I want to get the PackageName and signature of my app and send it to the server (all this work should be done in Go files) Question…
1
vote
0 answers

Why activity label doesn't appear in App Info?

A strange thing occurs to my app. I set labels for most AndroidManifest.xml nodes still my app doesn't get label in App Info activity! I expect to see "Git Sync" while I see "com.githun.sync" as shown in the screenshots What's wrong in my…
mbnoimi
  • 490
  • 4
  • 21
1
vote
0 answers

Go Lang: gomobile bind optimize code built for armv7-a and arm64-v8a

I am struggling to build Go Lang into .so with binding to AAR file. This is code I use for building CGO_ENABLED=1 \ gomobile bind \ -target=android/arm \ -ldflags="-w -s" \ -o export.aar \ -v My goal is…