Java code debugging in qt for android

I think you are creating an Android application.

First, you need to create a project for Android Studio. To do this, just go to Projects\Build Settings\Build Android APK and press the "Create Template" button in the Android section:

0_1541788639720_Captura.PNG

Open the generated project using Android Studio. Place breakpoints on JAVA code.

On Android Studio there is an option to attach to a running application. Use Qt Creator to debug the application and attach Android Studio to the application. After attaching, Android Studio stops at breakpoint when cpp code calls JAVA code.

 

After Android Studio opens the generated project, build.gradle may report an error:

androidCompileSdkVersion not found, androidBuildToolsVersion not found, qt5AndroidDir not found

The reason is that Qt Creator has copied one less file for us. In the compilation output directory/android-build/gradle.properties, the above variables are defined. Just copy it to the directory of the project you generated.

After Android Studio 3.0, minsdkversion is no longer specified in the AndroidManifest.xml file. Instead, it is specified in the gradle config file. However, qt creator needs to specify minsdkversion in the AndroidManifest.xml file. Please note here.

Guess you like

Origin blog.csdn.net/rankun1/article/details/86648776