Skip to content

in android, println not working. #10287

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

Closed
ksh8281 opened this issue Nov 5, 2013 · 8 comments
Closed

in android, println not working. #10287

ksh8281 opened this issue Nov 5, 2013 · 8 comments
Labels
O-android Operating system: Android

Comments

@ksh8281
Copy link
Contributor

ksh8281 commented Nov 5, 2013

i work with latest rust(bf98981).
i try to run simple code on android-18 with ndk-r9

fn main() { println("hello"); }

but it failed with this message below

task '<main>' failed at 'Unhandled condition: io_error: rt::io::IoError{kind: IoUnavailable, desc: "I/O is unavailable", detail: None}'
@alexcrichton
Copy link
Member

This is likely because the rustuv crate is either not being linked against or not being found. Are you sure that you're pushing the rustuv crate to the device?

@ksh8281
Copy link
Contributor Author

ksh8281 commented Nov 6, 2013

yes. i testing with

libanon_trait_static_method_lib-15fb3a718ea23983-0.0.so
libanonexternmod-15fb3a718ea23983-0.1.so
libextra-a7c050cfd46b2c9a-0.9-pre.so
libgnustl_shared.so
librustrt.so
librustuv-d4277cd5f62aa99-0.9-pre.so
libstd-6c65cf4b443341b1-0.9-pre.so
<my test helloworld>

in same folder and i try to run my helloworld program with command below

 <adb shell>#LD_LIBRARY_PATH=. ./<my test helloworld>

@alexcrichton
Copy link
Member

hm that's not a good sign. This will happen whenever the crate isn't compiled against the rustuv crate (it's got the #[no_uv] attribute, or the rustuv crate couldn't be found at runtime (one of its weak symbols wasn't resolved).

I'm not exactly sure why that's happening in this case, and that requires further investigation.

@luqmana
Copy link
Member

luqmana commented Nov 6, 2013

Hmmm, seems to work for me:

-> % adb shell
root@generic:/ # cd /data/tmp/rust
root@generic:/data/tmp/rust # ls
hello
libgnustl_shared.so
librustrt.so
librustuv-d4277cd5f62aa99-0.9-pre.so
libstd-6c65cf4b443341b1-0.9-pre.so
root@generic:/data/tmp/rust # LD_LIBRARY_PATH=. ./hello
Hello World!

@ksh8281
Copy link
Contributor Author

ksh8281 commented Nov 6, 2013

i found my problem. i tried to compile rust with arm-linux-androideabi-gcc-4.8
it cause complile error, but retry compiling rust, weird..compile is continue.
i think rust is only compiled with arm-linux-androideabi-gcc-4.6.

@ksh8281 ksh8281 closed this as completed Nov 6, 2013
@luqmana
Copy link
Member

luqmana commented Nov 6, 2013

@ksh8281 well i guess that fixes the immediate issues but I think we'd like to be able to use gcc-4.8 eventually for android so perhaps open another issue for that?

@ksh8281
Copy link
Contributor Author

ksh8281 commented Nov 7, 2013

#10323

@ksh8281
Copy link
Contributor Author

ksh8281 commented Nov 7, 2013

@luqmana i found what is exact problem

bors pushed a commit to rust-lang-ci/rust that referenced this issue Dec 1, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Dec 1, 2023
…_to_ref-tests, r=blyxyas

Add tests for issues rust-lang#10285, rust-lang#10286, rust-lang#10289, rust-lang#10287

Fixes rust-lang#10285.
Fixes rust-lang#10286.
Fixes rust-lang#10289.
Fixes rust-lang#10287.

This PR simply adds tests for the listed issues as they're already implemented so we can close them.

r? `@blyxyas`

changelog:none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android Operating system: Android
Projects
None yet
Development

No branches or pull requests

3 participants