Thanks!
Not using the packages was the issue.
On Friday, October 19, 2018 at 10:10:25 AM UTC+2, Elias Naur wrote:
>
> You're not using the imports. To avoid generating for the entire Android
> API, the reverse generator only generates bindings referenced by your code.
> For examples, see
You're not using the imports. To avoid generating for the entire Android
API, the reverse generator only generates bindings referenced by your code.
For examples, see golang.org/x/mobile/bind/testdata/testpkg/javapkg. This
works for me:
$ gomobile bind
Hi,
I just tried but it doesn't work:
$ ls
/Users/timcooijmans/Development/AndroidSDK/platforms/android-27/android.jar
/Users/timcooijmans/Development/AndroidSDK/platforms/android-27/android.jar
$ gomobile bind -v -bootclasspath
I see. For Android API, you'll need to specify the bootstrap classpath by
setting the gomobile -bootclasspath flag to point to the android.jar from
the Android SDK that matches your platform version. For example:
$ gomobile bind -bootclasspath /platforms/android-27/android.jar
If you need
Simple example:
package test
import (
"Java/android/content"
"Java/android/content/pm"
)
func Test() string {
return "Hello world"
}
returns
$ gomobile bind -v git.xxx.com/test
type-checking package "git.xxx.com/test" failed