Skip to content
This repository has been archived by the owner on Jun 8, 2019. It is now read-only.

gomobile errors on bind #76

Open
jonasfranz opened this issue Oct 27, 2017 · 2 comments
Open

gomobile errors on bind #76

jonasfranz opened this issue Oct 27, 2017 · 2 comments

Comments

@jonasfranz
Copy link
Member

jonasfranz commented Oct 27, 2017

I've tried to create an android library out of the gitea go-sdk via gomobile. But gomobile fails with the following errors.

Executed command:

gomobile bind -target android -o gitea.aar -javapkg io.gitea.code.sdk code.gitea.io/sdk/gitea

Error(s):

gomobile: go build -pkgdir=$GOPATH/pkg/gomobile/pkg_android_arm -buildmode=c-shared -o=/tmp/gomobile-work-631988229/android/src/main/jniLibs/armeabi-v7a/libgojni.so /tmp/gomobile-work-631988229/androidlib/main.go failed: exit status 2
# _/tmp/gomobile-work-631988229/gomobile_bind
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:1998:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_CreatePayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:1991:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:3658:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_IssuePayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:3651:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5048:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_PullRequestPayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5041:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5171:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_PushPayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5164:1: note: previous definition is here
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5818:1: error: redefinition of 'Java_io_gitea_code_sdk_gitea_RepositoryPayload_setSecret'
/tmp/gomobile-work-631988229/gomobile_bind/java_gitea.c:5811:1: note: previous definition is here
@lunny
Copy link
Member

lunny commented Oct 27, 2017

I have encountered the same issue on another library.

@jonasfranz
Copy link
Member Author

This is be caused by gombile. Gomobile compiles struct parameters to getSecret and setSecret. So if a struct has the parameter secret and a function setSecret will this cause an error.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants