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
1
vote
2 answers

Gomobile toolchain out of date, only in Android Studio

I am working with the latest gomobile, Go, and Android Studio builds. When I run the gradle tasks from the terminal they work as expected and build the correct binaries, however from within Android Studio I receive an error: bin/gomobile: toolchain…
Steve
  • 469
  • 4
  • 12
1
vote
1 answer

os.Create and os.Open not working with gomobile and react native

package component import ( "encoding/json" "io/ioutil" "os" ) type LastComponent struct { Name string } const fname = "componentfiles" func Persist(comp string) string { lcomp := LastComponent{Name: comp} b, err :=…
Minty
  • 1,163
  • 11
  • 18
1
vote
1 answer

Cannot get gomobile binding to work with java

Go version: 1.7.5 GOPATH = D:/GoWork React Native version 0.41 Code below is the binding go package at D:\GoWork\src\rngo\rngo\rngo.go Very simple, just returning a string package rngo // RNcall is used to bind with RN func RNcall() string { …
Minty
  • 1,163
  • 11
  • 18
1
vote
1 answer

"Unsupported flags DT_FLAGS_1=0x9" error on android gomobile

What I got going on in the project is a Cordova project that uses gradle to build. I created an android plugin that calls the Go script in the form of an .aar. All works with the simple hello world.go .aar. So I know that everything works. But…
Roger Large
  • 105
  • 12
1
vote
1 answer

Call JS bundle from GoMobile?

It's my understanding that ReactNative compiles it's JavaScript into a JS bundle available here: http://localhost:8081/index.ios.bundle Is it possible within GoMobile to render a view using that JS bundle file? I'm trying to figure out if I can use…
1
vote
2 answers

Gomobile android using callbacks

I have an library written using go mobile and it should has only one callback but when trying implement it, I get two additional methods. @Override public Seq.Ref ref() { return null; } @Override public void call(int i, Seq seq, Seq seq1)…
user6012081
1
vote
1 answer

How to use gomobile build sdk-arr-libs to access to web?

I use gomobile bind generated an .arr file. gomobile version gomobile version +e154aff Wed Dec 2 14:48:43 2015 +0000 (android); androidSDK=D:\android\sdk\platforms\android-23 go version go version go1.5.2 windows/amd64 Go code include a func…
hardPass
  • 19,033
  • 19
  • 40
  • 42
1
vote
1 answer

`gomobile build` and `gomobile install` throws "gomobile: EOF"

I'm trying to build an android application using gomobile but the commands gomobile install and gomobile build fail with gomobile: EOF . Before this error I was getting this error: # golang.org/x/mobile/gl In file included from…
Anthony Hunt
  • 1,470
  • 5
  • 20
  • 32
0
votes
0 answers

calling go net.InterfaceAddrs() fails on Android SDK 30+

The issue 40569 makes Golang (mobile binding) incompatible with Android SDK 30+. Calling the stdlib function net.InterfaceAddrs() gives an error due to changes made in Android SDK 30. Discussion suggests that it can be resolved by modifying go…
0
votes
0 answers

how to gomobile stream communication with channels or callbacks

I am trying to implement a chat client with a function Listen() which is forever listening to incoming messages. In my exposed function I convert a channel by iterating over everything it sends and forwarding it with a callback by the receiver (eg…
mama
  • 2,046
  • 1
  • 7
  • 24
0
votes
1 answer

LoadLibrary() fails when added aar library to system service?

I wrote a System Service, but it fails on boot with the message: java.lang.UnsatisfiedLinkError: dlopen failed: library "libgojni.so" not found Basically in the code of the .aar library it tries to load a library using System.loadLibrary() but it…
0
votes
1 answer

How to install an older version of gomobile

after an OS re-install (MacOS Big Sur) I'm trying to get my go & gomobile development environment set up again. I have a specific version requirement for my app so I am using go 1.13.x, installed via homebrew. I then installed gomobile via the…
Dominik
  • 1,366
  • 2
  • 18
  • 37
0
votes
1 answer

How to install gomobile properly on Windows?

I'm on Windows 10, with go 1.16.7 windows/amd64 installed. Already defined GOPATH to C:\Users\anta40\Codes\Go. While in GOPATH, I ran these 2 commands: go env -w GO111MODULE=auto go get golang.org/x/mobile/cmd/gomobile OK now let's run…
anta40
  • 6,511
  • 7
  • 46
  • 73
0
votes
1 answer

"gomobile build" how to create files and write to files (external micro-SD card installed on Samsung tablet) (in APK)?

Original quetion: Does anybody know how does gomobile build (not bind) support FileSystem? I was able to use the asset package for opening and reading files as discussed in this discussion. But not sure how I can create an write to new files in an…
Ashkanxy
  • 2,380
  • 2
  • 6
  • 17
0
votes
1 answer

gomobile build, the Paho mqtt client cannot connect to mqtt broker in APK

I am working on a project where I need to use gomobile tool to create an Android app. The sample code I have in Go is as below var broker = "127.0.0.1" //var broker = "broker.mqttdashboard.com" var port = 1883 opts :=…
Ashkanxy
  • 2,380
  • 2
  • 6
  • 17