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

x/mobile: gobind reverse bindings mistakes struct fields with embedding a java class #19737

Open
microo8 opened this issue Mar 28, 2017 · 0 comments
Labels
mobile Android, iOS, and x/mobile
Milestone

Comments

@microo8
Copy link

microo8 commented Mar 28, 2017

What version of Go are you using (go version)?

go version go1.8 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/micro/Workspace"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build006260206=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"

x/mobile version

my x/mobile is updated to the latest commit in Date: Tue Feb 21 21:57:37 2017 +0100

What did you do?

I've created an MainActivity and embedded android.app.Activity. Then I added a android.webkit.WebView field to the struct and ran ./gradlew assembleDebug.
Here is the code and build.gradle

What did you expect to see?

Successfully compile and build an apk.

What did you see instead?

:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:preReleaseBuild UP-TO-DATE
:prepareComAndroidDatabindingAdapters121Library UP-TO-DATE
:prepareComAndroidDatabindingLibrary121Library UP-TO-DATE
:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:prepareDebugDependencies
:compileDebugRenderscript UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:dataBindingProcessLayoutsDebug UP-TO-DATE
:compileDebugAidl UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:gobindDebug
type test1.MainActivity struct{Java/android/app.Activity; MyWebView Java/android/webkit.WebView} embeds more than one Java class; only one is allowed.
type test1.MainActivity struct{Java/android/app.Activity; MyWebView Java/android/webkit.WebView} embeds more than one Java class; only one is allowed.
type test1.MainActivity struct{Java/android/app.Activity; MyWebView Java/android/webkit.WebView} embeds more than one Java class; only one is allowed.
type test1.MainActivity struct{Java/android/app.Activity; MyWebView Java/android/webkit.WebView} embeds more than one Java class; only one is allowed.
:gobindDebug FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gobindDebug'.
> Process 'command '/home/micro/Workspace/bin/gobind'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I think that gobind mistakes the struct fields with embedding a java class.

@gopherbot gopherbot added this to the Unreleased milestone Mar 28, 2017
@bradfitz bradfitz added the mobile Android, iOS, and x/mobile label Jul 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mobile Android, iOS, and x/mobile
Projects
None yet
Development

No branches or pull requests

3 participants