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

use different dioxus versions depending on the platform #741

Closed
alexzanderr opened this issue Jan 10, 2023 · 13 comments
Closed

use different dioxus versions depending on the platform #741

alexzanderr opened this issue Jan 10, 2023 · 13 comments

Comments

@alexzanderr
Copy link

hello.

im trying to use the revision 1e99e35 for android and latest version of dioxus from master on the desktop.

referenced issue here: rust-lang/cargo#7753 (comment)

why im trying to do this? because latest version of dioxus doesnt work on android. [maybe i will open a separate issue]

why revision 1e99e35? because this revision works on android and so this revision is used by default in a project template when you create a new project with x new (cargo xbuild)

the problem is: this revision, 1e99e35, doesnt have all the cool new features that i can use and so im trying to mix the both in the same codebase with conditional compilation, of course.

does anyone have a workaround for this?

thanks in advance!

@alexzanderr
Copy link
Author

i've even tried different paths depending on activation of the features, but that goes into the issue mentioned from cargo.

depending on activation of the features

why this doesnt work? it works, but when macro expansion happens from within the rsx! macro doesnt work. dependency ::dioxus is used and expected by the macro. i've tried to use something like this: use dioxus_030 as dioxus, but this doesnt work [i can make a separate issue for this if needed].

@dvc94ch
Copy link
Contributor

dvc94ch commented Jan 10, 2023

author of xbuild here: dioxus 0.3.0 should work on android. updated the template here: rust-mobile/xbuild#104

@alexzanderr
Copy link
Author

ok. so how do i reflect the change of the template on my system?

by updating cargo-xbuild by running: cargo install --force cargo-xbuild ?

@alexzanderr
Copy link
Author

did something related to the code of xbuild changed? or just the template changed?

because i've tried dioxus 0.3.0 on android, and everything compiles well and even installs correctly on android, but when i open the app, the ui doesnt respond, and when im trying to type some text into an html input, the app crashes.

@dvc94ch
Copy link
Contributor

dvc94ch commented Jan 10, 2023

And that issue doesn't exist with the older dioxus version? In that case you should open a bug report once you've made sure that it isn't a user error. It sounds like it is maybe a duplicate of #626

@alexzanderr
Copy link
Author

And that issue doesn't exist with the older dioxus version?

yes, with 1e99e35, no issue

@alexzanderr
Copy link
Author

alexzanderr commented Jan 10, 2023

ok, seems that this is the only change in the template PR: rust-mobile/xbuild@7e40e18

what i understood from what you said is that if i use the version bumps from the pull request on the template, dioxus 0.3.0 should work on android. right?

meaning that: i can use a project made with the old version of the template on which i only need to change the versions to update to latest dioxus. right?

lets see..

@dvc94ch
Copy link
Contributor

dvc94ch commented Jan 10, 2023

not saying there aren't any bugs. dioxus 0.3 was just released recently and rewrote large parts of the internals. just started testing the 0.3 release and hit some bugs:

@alexzanderr
Copy link
Author

use_atom_ref with Fermi gives errors #734, honestly, i dont really understand why dioxus panics a lot in the source. i've also found a lot of panics.

have you considered using Results and propagating the error to the user to not panic at all?

@alexzanderr
Copy link
Author

ok, seems that this is the only change in the template PR: rust-mobile/xbuild@7e40e18

what i understood from what you said is that if i use the version bumps from the pull request on the template, dioxus 0.3.0 should work on android. right?

meaning that: i can use a project made with the old version of the template on which i only need to change the versions to update to latest dioxus. right?

lets see..

ok so the smallest example build with old template but with bumped versions works on android.

thanks for the suggestions and help!

now lets see if i can port my project to 0.3.0, after that i will close the issue.

@alexzanderr
Copy link
Author

alexzanderr commented Jan 10, 2023

doesnt work. false positive.

this example doesnt work

fn app(cx: Scope) -> Element {
    let mut count = use_state(&cx, || 0);


    cx.render(rsx! {
        div {
            "hello world"
            input {

            }

            h1 { "Count: {count}" }

            button { onclick: move |_| count.set(1), "+" }
            button { onclick: move |_| count.set(-1) , "-" }

            div {
                "just a div"
            }
            button {
                "just a button"
            }
        }
    })
}

more specific, when you press the + or - button, the UI freezes and nothing else its working.

seems to be related to this part

            button { onclick: move |_| count.set(1), "+" }
            button { onclick: move |_| count.set(-1) , "-" }

something happens there. i guess deadlock? maybe. a deadlock would a good candidate for a freeze.

x run --device X doesnt show any panics or errors after deploying the app

@alexzanderr
Copy link
Author

just this log appears after pressing the + or - buttons.

13415 13415 I IMM_LC  : hideSoftInputFromWindow - mService.hideSoftInput
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 0
13415 13415 I ViewRootImpl@9e973b6[MainActivity]: ViewPostIme pointer 1

these logs represent me touching the phone on and on, but like i said nothing happens.

@alexzanderr
Copy link
Author

non related: how can i debug such applications that run on android? to know what part of the code is raising errors or panics or deadlocks.

or what can i do to see whats happening?

@jkelleyrtp jkelleyrtp closed this as not planned Won't fix, can't repro, duplicate, stale Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants