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

Unable to build mobile (android) library #4382

Closed
yzernik opened this issue Jun 16, 2020 · 3 comments · Fixed by #4469
Closed

Unable to build mobile (android) library #4382

yzernik opened this issue Jun 16, 2020 · 3 comments · Fixed by #4469
Labels
documentation Documentation changes that do not affect code behaviour golang/build system Related to the go language and compiler mobile

Comments

@yzernik
Copy link

yzernik commented Jun 16, 2020

Background

I am trying to build the Lndmobile.aar file to use in my Android app. I tried to follow the instructions here: https://github.com/lightningnetwork/lnd/blob/master/mobile/README.md

I was able to run the "make android" command, and it exited with exit code 0. It generated the files in /root/go/src/github.com/lightningnetwork/lnd/mobile/. The Lndmobile.aar and Lndmobile-sources.jar are both created.

The Start method of Lndmobile is missing. It shows a comment in it's place:

// Code generated by gobind. DO NOT EDIT.

// Java class lndmobile.Lndmobile is a proxy for talking to a Go program.
//
//   autogenerated by gobind -lang=java github.com/lightningnetwork/lnd/mobile
package lndmobile;

import go.Seq;

public abstract class Lndmobile {
	static {
		Seq.touch(); // for loading the native library
		_init();
	}
	
	private Lndmobile() {} // uninstantiable
	
	// touch is called from other bound packages to initialize this package
	public static void touch() {}
	
	private static native void _init();
	
	
	
	// skipped function Start with unsupported parameter or return types
	
}

Your environment

  • version of lnd: v0.10.1-beta
  • which operating system (uname -a on *Nix): ubuntu:20.04
  • version of btcd, bitcoind, or other backend: None
  • any other relevant environment details: I was able to run "make android" directly on my host machine, and in a Docker container. I got the same output for both.

Steps to reproduce

https://github.com/yzernik/lnd-mobile-docker

Expected behaviour

The Lndmobile.aar file should be generated correctly. When I import it into Android Studio, I should be able to call the "Start" method:

Lndmobile.start("--bitcoin.active --bitcoin.node=neutrino --bitcoin.testnet --no-macaroons", new StartCallback());

Actual behaviour

The Lndmobile.aar file is not generated correctly. When I import it into Android Studio, I am unable to call the "Start" method, because the "Start" method does not exist.

@Roasbeef Roasbeef added documentation Documentation changes that do not affect code behaviour golang/build system Related to the go language and compiler mobile labels Jun 18, 2020
@cfromknecht
Copy link
Contributor

@yzernik there has been some recent shuffling around the entry point for lnd, are you able to find the most recent version for which things do compile, e.g. 0.10?

@halseth
Copy link
Contributor

halseth commented Jun 21, 2020

Doesnt compile:

/src/github.com/lightningnetwork/lnd/mobile/bindings.go:70:21: not enough arguments in call to lnd.Main
	have (lnd.ListenerCfg)
	want (*lnd.Config, lnd.ListenerCfg, <-chan struct {})
/src/github.com/lightningnetwork/lnd/mobile/bindings.go:87:45: not enough arguments in call to lnd.WalletUnlockerAuthOptions
	have ()
	want (*lnd.Config)

@guggero
Copy link
Collaborator

guggero commented Jun 22, 2020

The changes mentioned above were introduced in master and v0.10.2 (which is still in RC at this moment).
@yzernik if you go back to lnd v0.10.0-beta it should compile. We will fix the mobile code to be compatible with v0.11.0 once it's out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Documentation changes that do not affect code behaviour golang/build system Related to the go language and compiler mobile
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants