Reputation: 923
So I am having this very annoying problem with Qt Creator. When I try to build any application I get the following:
.../NDK/android-ndk-r19c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++: not found Project ERROR: Cannot run target compiler
Now I have read here that this might be because of due to Android Studio and this can be solved just downloading the NDK separately from Google's website. So far I have tried the following things:
Removed Android Studio
Installed the SDK tools separately
Installed the NDK separately
Downgraded my JDK version to 8
Tried with different versions of the NDK (I have tried 20,19 and 18)
However none of these solutions work. I am using Qt Creator 4.9.2 with Qt 5.13.
Upvotes: 3
Views: 2119
Reputation: 89
What worked for me was setting the correct path to the toolchain I want to use
i.e. After Downloading and extracting the correct toolchain (r15c in my case) set the ANDROID_NDK_ROOT to that specific path of the (r15c) toolchain root folder without the ending "/".
Projects>Build & Run>Android for ...(Specific Platform)>Build>Build Environment>ANDROID_NDK_ROOT.
And it worked like a charm.
Upvotes: 0
Reputation: 12573
Since ndk r19, the toolchains are already completely changed to llvm/clang, see here: https://stackoverflow.com/a/54800967/8034839 for more details.
From your error message, it looks you set the toolchain to gcc rather than clang, which might be the problem.
Upvotes: 2