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: regression error #17277
Comments
You say somethings fails, but what is the error message? If the error is an unexpected crash and you'd like me to investigate further, please try to make a stand alone reproducer I can run (with gradle). One way is to modify the gomobile "bind" example to exercise the problematic code. |
ok i will make a fork of it al for you now.. 1 minute |
https://github.com/joeblew99/mobile-sdk just gomobile build from root. then adjust the build.gradle (Module:logpackermobilesdk) that shoudl then build. But you wont get an .apk, because i cant work out the correct code to instantiate the code at the android level now. Things have changed a few bit it seems. Anyway have a look The 2nd thing i want to remind about is the OLD code regression bug https://github.com/logpacker/mobile-sdk/blob/a1b9b7a16a88b53f23dfd85a66b1127d63672b66/api.go#L52 This used to work for gomobile, and then broke recently, and i guess it will break lots of others.. Let me knwo if i can help... |
Thank you. You've provided me with an example, but not yet the error message. What is the error message you're seeing that you don't expect? You seem to mention two issues, please provide an error message for each issue. |
in android studio on build > APK, you get error message
|
Those errors are caused by a recent change to gomobile that moves the generated classes out of the main package class. Replace
with
and remember to import go.logpackermobilesdk.Client and go.logpackermobilesdk.Message. This is an unfortunate backwards incompatible change, but not a bug. |
thank you.. Now all works. I prefer the new structure of the Android Java code... Its much more intuitive. big thankyou... The 2nd error message was related to the first. Property Accessors in golang were clashing with the ones you generate in Java. |
@eliasnaur
Please answer these questions before submitting your issue. Thanks!
Hey, i hit a nasty regression bug.
It also broke the Android and IOS code too.
I fixed it by removing the offending func call. See below.
But now all the front end code is broken, and i cant work out how the android code should be :)
What version of Go are you using (
go version
)?1.7.1
darwin
What operating system and processor architecture are you using (
go env
)?What did you do?
You can git clone from the tree
This code cause gomobile bind . to fail:
https://github.com/logpacker/mobile-sdk/blob/a1b9b7a16a88b53f23dfd85a66b1127d63672b66/api.go#L52
Removing just that func allows the build to work.
First potential issue i see is that this is very typical legal go code !!! Me and a ton of code sets a value on a struct via a func. Its basically a Set property accessor in the Java world if i remember correctly.
Anyway, this break this git repo, and a fair bit of other code.
Second thing, is that the code now looks very different in the Android world.
This now longer works at all.
The text was updated successfully, but these errors were encountered: