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: some question #19006

Closed
solua opened this issue Feb 9, 2017 · 10 comments

Comments

Projects
None yet
5 participants
@solua
Copy link

commented Feb 9, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.7

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

IOS, Android

What did you do?

Generate a lib with gomobile

What did you expect to see?

Function call completely

What did you see instead?

Function not response

@solua

This comment has been minimized.

Copy link
Author

commented Feb 9, 2017

Thanks gomobile team for amazing project.

I have used gomobile in 3 project. Generate lib for android and ios app.
I have no issues with android, but with ios.
Sometime I open a new thread and call function login in go lib but function didn't response.
This issue happen sometime and in some device not all (Iphone 7, Iphone 6).
My login function make a http request, it too simple too make problem.
Can you suggest me ?

@bradfitz bradfitz added this to the Unreleased milestone Feb 9, 2017

@bradfitz bradfitz changed the title x/mobile: x/mobile: some question Feb 9, 2017

@minux

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

@solua

This comment has been minimized.

Copy link
Author

commented Feb 9, 2017

Please answer these questions before submitting your issue. Thanks!

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

1.7

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

IOS version 10.2.1
Xcode version 8.2
Swift 3.0

What did you do?

Generate a share lib with gomobile.
gomobile bind -target=ios

Bug happen sometime in some device not all.
App didn't crash but go function didn't response.

When user click Login button, Swift take event and make new thread. Thread call login function in go, and go have nerver responsed.

App ok almost time, bug happen some time and unpredictable.

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Feb 9, 2017

Have you tried to reproduce the hang while running from Xcode? In that case, you might be able to pause the app and see where it is stuck.

Is it possible to send me a small sample that exhibits the buggy behaviour?

@solua

This comment has been minimized.

Copy link
Author

commented Feb 9, 2017

Hi Eliasnaur,

I tried it many time, if bug happen, function map from go nerver return.
For example, I checked debug at line 50, call go function at line 49, my debug point nerver hit. No exception, no crash, no log( I insert log in go to make sure).
I , sometime, think thread run go was killed by os.

Thanks for your time Eliasnaur.
Run go with love

@minux

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

@solua

This comment has been minimized.

Copy link
Author

commented Feb 9, 2017

This is my proxy struct:
type AppProxy interface {
Log(logMess string)
LoginNotify(code int)
}

Public function:

func Login(userName,pwd string,proxy AppProxy) {

proxy.Log("Begin login call")
result := login(userName,pwd)
if result {
proxy.LoginNotify(0)//login success
}else{
proxy.Log("Login fail")
}
proxy.Log("End login")
}

I implement AppProxy in Swift with swift log function (NSLog)
But no log appear in Xcode, no crash and my debug point have never hit.

Thanks.

@eliasnaur

This comment has been minimized.

Copy link
Contributor

commented Feb 9, 2017

If you want me to debug your issue, I'll need a complete sample I can run in Xcode.

@solua

This comment has been minimized.

Copy link
Author

commented Feb 10, 2017

Hi Eliasnaur,

I think this issues because something wrong in IOS os, android is ok.
I will try it again in new project.
If it happen again, I will push full source code.

Thank Eliasnaur,

1 similar comment
@solua

This comment has been minimized.

Copy link
Author

commented Feb 10, 2017

Hi Eliasnaur,

I think this issues because something wrong in IOS os, android is ok.
I will try it again in new project.
If it happen again, I will push full source code.

Thank Eliasnaur,

@solua solua closed this Feb 10, 2017

@golang golang locked and limited conversation to collaborators Feb 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.