#Cargo mobile android run => gen/android/creative-blogger empty
1 messages · Page 1 of 1 (latest)
The problem is because you are cross compliling from x86 to arm and it openssl-sys couldn't find the right version of openssl
You can link to an openssl built for arm by setting $Env:OPENSSL_DIR = "/path/to/aarch64-linux-android"
or setting openssl-sys to use the vendored feature which should try to build Openssl for the target arch automatically
You can do this by setting openssl = { version = "*", features = ["vendored"] } in your cargo.toml or most crates that require openssl have a vendored feature flag you can use
Let me know if that works or you have any other questions. I just spent like a week digging into openssl-sys to get it to cross compile from windows -> andriod lol 😅
Was that with setting OPENSSL_DIR or vendored feature
I'm not 100% sure. I think it might be
do you have libssl-dev installed?
on Ubuntu
I'm not 100% what missing. I feel like it should be installed. I'll google some and see
I haven't found out exactly what it is. Looks like the build-script is missing that program for compiling openssl on linux but not sure where it comes from. Maybe the android ndk but not 100% sure
Not sure you might have more luck building openssl manually for android and linking to it export OPENSSL_DIR="openssl_arm64-android"
here's one i compiled if you want to test it out. Remember to remove the openssl = { version = "*", features = ["vendored"] } from your cargo.toml or it'll keep trying to build it manually
Ok i'll let you know if I think of anything else
This error is saying the OPENSSL_DIR environment variable wasn't set
if you run printenv does it show up?
Yeah it's super weird because its saying OPENSSL_DIR unset in the error msg but in your example you set it and printenv is showing it set
cargo build --target=aarch64-linux-android
can you try building it manually by running the above cargo command instead of cargo mobile android run
rustup target add aarch64-linux-android
might help if you haven't got it installed yet
ok thats good
really weird I feel like it should work.
It took me like a week to get openssl working with android. Maybe I forgot a change I made to my system.
Yeah the android is a mess and such a pain to get setup 🤣
can you post the full error msg
I think i found it.
In my path (on windows)I have
D:\androidsdk\ndk\25.2.9519653\toolchains\llvm\prebuilt\windows-x86_64\bin\
which has aarch64-linux-android-clang in it
You just need to find where it is on your system. It should be in your android ndk install
yeah
Good luck i hope this works haha
no worries take your time
the error with cargo mobile android run is still that its not finding the OPENSSL_DIR variable. Probably something with gradle not picking it up not sure
the first error seems to be with the package I sent you. It might not be right
I got the package from https://github.com/microsoft/vcpkg
running vcpkg install openssl:arm64-android
I'm also going for dinner now. I'll check more later
yah its 7pm or me haha
is aarch64 and arm64 the same? I thought they were but maybe not
I would try installing vcpkg and creating it yourself
It seems something is wrong with the cross compiling and linking
I'm away from my computer right now but if you check the /config-arm64-android-rel-err.log
it'll say you have to set an env variable to link to the android ndk
I forget the name off the top of my head
I won't be back at my computer for another 3-4 hours.
I feel like it should be working. But hopefully after you compile on your device it should link correctly
We can also try using the google pixel emulator which uses x86. Thats the one I'm using for testing so I know I have a working openssl for that
ANDROID_NDK_HOME = "D:\androidsdk\ndk\25.2.95196" is the env variable you have to set for vcpkg
ANDROID_NDK_HOME
Went through getting android stuff setup today
Ran into an issue on the tauri side of things 😦 https://github.com/tauri-apps/tao/issues/760
I was able to get it fixed but we will have to wait for the fix to be merged before releasing