1

I'm having a hard time to have the debugger running on an external device.

Using - the latest Qt Creator and Qt framework 5.9.2 - Android SDK & NDK installed with the Android Studio - Java jdk1.8.0_152 - Android API 26 - Win 10.

I can build and run the app in debug on a x86 Android emulator successfully.

I can successfully build for amd but when I try to run in debug my external device, it crashes right away and fails to connect to the debugger with the message "Failed to contact debugging port."

The app crash at start if manually started.

The USB debug is enabled on the phone.

Is there any additional configuration required?

1 Answer 1

2

Finally after much digging.

The compiler used with QtCreator generates armeabi-v7a lib files.

Those files are included into the /libs/ folder on the apk.

Our project required to use some other external libs that were also compiled for other architectures. The folder /libs/ of the generated apk contained libs for those different architecture, but the main project was available only for the armeabi-v7a.

Therefore the app would be started and try to find the lib to the preferred architecture and would crash right away.

The solution is to force using only the available architecture.

This is done by adding this to the build.gradle script

 defaultConfig {
    ndk {
        abiFilters  'armeabi-v7a'
    }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.