Skip to content

Async function calls crashing app #321

@Enduriel

Description

@Enduriel

Thank you for working on this project, I hope I can get it working because this would be perfect for our use case.

I've created a test example project following the guidance here, with a basic test component that performs an action on button click.

I'm running off the main branch with a single commit to disable the RUSTFLAGS override, as with the main release I was getting a differ, and using react native 0.81.1 with uniffi 0.29.

I added these functions for basic testing to my main crate

#[cfg_attr(feature = "uniffi", uniffi::export)]
pub fn foo() -> String {
	log::info!("foo called");
	"bar".to_string()
}

#[cfg_attr(feature = "uniffi", uniffi::export)]
pub async fn foobar() -> String {
	log::info!("foobar called");
	"foorbar".to_string()
}

and I have a basic testing component that executes this code when I click a button

console.log('Executing login...');
const result1 = foo();
console.log('Foo result:', result1);
const result2 = await foobar();
console.log('Foobar result:', result2);

foo() is executed perfectly, but the moment I await foobar either on IOS or android, it crashes with very little to go off of in the log: ios android.

Please let me know if I'm missing something or if there's something else you'd like me to try, I would appreciate any help because I really am not sure what to do here.

Once again thank you for your work here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions