Below are the key parts to get it to work in the context of a Gradle activity.
myproject.pro
# ...
android {
QT += androidextras
# Default rules for deployment.
include(deployment.pri)
DISTFILES += \
android/gradle/wrapper/gradle-wrapper.jar \
android/AndroidManifest.xml \
android/res/values/libs.xml \
android/build.gradle \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew \
android/gradlew.bat \
android/src/com/example/myproject/MySubclassOfQtActivity.java
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
}
# ...
deployment.pri
android-no-sdk {
target.path = /data/user/qt
export(target.path)
INSTALLS += target
} else:android {
x86 {
target.path = /libs/x86
} else: armeabi-v7a {
target.path = /libs/armeabi-v7a
} else {
target.path = /libs/armeabi
}
export(target.path)
INSTALLS += target
} else:unix {
isEmpty(target.path) {
qnx {
target.path = /tmp/$${TARGET}/bin
} else {
target.path = /opt/$${TARGET}/bin
}
export(target.path)
}
INSTALLS += target
}
export(INSTALLS)
Gradle searches and finds the libs properly in the libs directory and it gets bundle properly by Qt creator during the deployment.
Examining build.gradle
it has: android > sourcesets > main > jniLibs.srcDirs = ['libs']
Hope that helps.