Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
Qt Creator 4.9.1
-
None
-
Development OS: Windows 10
Android SDK: 26.1.1
Android SDK Platform Tools: 29.0.0
Connected device: Samsung S8 with android 9
Description
When trying to deploy an android app, all connected devices are listed as "incompatible" with this error information : 'ABI is incompatible, device supports ABIs: .' (no ABI!)
Problem comes from two sides : ADB and QtCreator. This is what I diagnosed:
When calling adb with "shell getprop ro.product.cpu.abilist" arguments to get supported ABIs, it correctly reports ABIs in stdout, but adb exit with non-0 exit code (-1073740940 in my case). I suppose that QtCreator interpret this as a failure code and won't parse stdout (in function AndroidConfig::getAbis, response.result is not SynchronousProcessResponse::Finished but SynchronousProcessResponse::TerminatedAbnormally)
I suppose it's more ADB's fault than QtCreator's one, but it would be appreciable that QtCreator try to parse stdout even if adb didn't finished normally.
I found a workaround in adb side by following these steps:
- Rename %AndroidSDK%\platform-tools\adb.exe as "adb.exe.bak.exe"
- Compile the following standard C++ code to make an adb wrapper :
#include <cstdlib> #include <string> #include <iostream> #include <algorithm> #include <cctype> int main(int argc, char *argv[]) { std::string strCmd = std::string(argv[0]); std::string strExt = strCmd.substr(strCmd.length() - 4, 4); std::transform(strExt.begin(), strExt.end(), strExt.begin(), [](unsigned char c) { return std::tolower(c); }); if (strExt.compare(".exe") != 0) strCmd += ".exe"; strCmd += ".bak.exe"; if (argc > 1) { for (int i = 1; i < argc; ++i) { strCmd += " \"" + std::string(argv[i]) + "\""; } } std::system(strCmd.c_str()); }
- Build this code as adb.exe and move it in %AndroidSDK%\platform-tools\