Open alecnotthompson opened 3 years ago
Hello!
It seems like the NDK release 23 removed the AR tool that is required for cargo-mobile
to work and I see others struggling with a similar issue.
For now, try reverting your NDK version through Android Studio to some earlier version. I've tested with 22.1.7171670 and it appears to be working.
Of course eventually, we should probably add support for NDK>=23 but for now this should be a functional workaround.
Hai! The NDK now uses llvm-ar in the same folder
Hai! The NDK now uses llvm-ar in the same folder
How can i change cargo mobile to target this instead?
Hai! The NDK now uses llvm-ar in the same folder
How can i change cargo mobile to target this instead?
a workaround is to create a symlink to all needed file:
export YOUR_ARCH_TYPE=linux-x86_64
# aarch64-linux-android-ar
ln -s $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/llvm-ar $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/aarch64-linux-android-ar
# arm-linux-androideabi-ar
ln -s $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/llvm-ar $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/arm-linux-androideabi-ar
# i686-linux-android-ar
ln -s $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/llvm-ar $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/i686-linux-android-ar
# x86_64-linux-android-ar
ln -s $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/llvm-ar $NDK_HOME/toolchains/llvm/prebuilt/$YOUR_ARCH_TYPE/bin/x86_64-linux-android-ar
_(the folder YOUR_ARCH_TYPE is most probably the only folder in $NDK_HOME/toolchains/llvm/prebuilt/
, you just need to look up its name)_
I seem to have had a bad android studio setup on my computer for years from only occasionally having react native gigs and can't figure out how to fix it.
After some toiling I think I have a working installation but can't run a cargo mobile generated project. It works just fine on desktop and iOS simulator (without legacy build system even!) and am getting the following error:
The file is indeed not in the folder it is looking in but I do see some
-as
files.Could it be that I have upgraded beyond supported android studio? 😠I don't know much about the build system or what I'm looking for but I did see this page saying certain things related to standalone toolchains are obsolete when googling things related to the error above.
Any help would be appreciated. I'm excited to finally be digging into a project with this tool!