Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

NDK and SDK versions with Qt 5.15.1



  • I don't understand anything anymore.
    What are the recommended versions of Android NDK, Android SDK to use with Qt 5.15.1?

    How to fix Android compatibility warnings ? I have more than twenty but I don't understand anything... Am I using a bad version of SDK ?

    Some examples of warnings

    StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/R$styleable;->TextView:[I
    	at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    	at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    	at java.lang.Class.getDeclaredField(Native Method)
    	at org.qtproject.qt5.android.ExtractStyle.extractTextAppearanceInformations(ExtractStyle.java:1329)
    	at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:2003)
    	at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:617)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:267)
    	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505)
    	at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:166)
    	at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:267)
    	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:274)
    	at android.app.Activity.performCreate(Activity.java:7144)
    	at android.app.Activity.performCreate(Activity.java:7135)
    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
    	at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:13)
    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
    	at android.os.Handler.dispatchMessage(Handler.java:106)
    	at android.os.Looper.loop(Looper.java:193)
    	at android.app.ActivityThread.main(ActivityThread.java:6718)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
    
    StrictMode policy violation: android.os.strictmode.NonSdkApiUsedViolation: Landroid/R$styleable;->TextView:[I
    	at android.os.StrictMode.lambda$static$1(StrictMode.java:428)
    	at android.os.-$$Lambda$StrictMode$lu9ekkHJ2HMz0jd3F8K8MnhenxQ.accept(Unknown Source:2)
    	at java.lang.Class.getDeclaredField(Native Method)
    	at org.qtproject.qt5.android.ExtractStyle.extractTextAppearanceInformations(ExtractStyle.java:1329)
    	at org.qtproject.qt5.android.ExtractStyle.extractListView(ExtractStyle.java:1816)
    	at org.qtproject.qt5.android.ExtractStyle.<init>(ExtractStyle.java:2016)
    	at org.qtproject.qt5.android.QtActivityDelegate.loadApplication(QtActivityDelegate.java:617)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at org.qtproject.qt5.android.bindings.QtLoader.loadApplication(QtLoader.java:267)
    	at org.qtproject.qt5.android.bindings.QtLoader.startApp(QtLoader.java:505)
    	at org.qtproject.qt5.android.bindings.QtActivityLoader.onCreate(QtActivityLoader.java:166)
    	at org.qtproject.qt5.android.bindings.QtActivity.onCreateHook(QtActivity.java:267)
    	at org.qtproject.qt5.android.bindings.QtActivity.onCreate(QtActivity.java:274)
    	at android.app.Activity.performCreate(Activity.java:7144)
    	at android.app.Activity.performCreate(Activity.java:7135)
    	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
    	at androidx.test.runner.MonitoringInstrumentation.callActivityOnCreate(MonitoringInstrumentation.java:13)
    	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
    	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
    	at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
    	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
    	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
    	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
    	at android.os.Handler.dispatchMessage(Handler.java:106)
    	at android.os.Looper.loop(Looper.java:193)
    	at android.app.ActivityThread.main(ActivityThread.java:6718)
    	at java.lang.reflect.Method.invoke(Native Method)
    	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
    	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
    

    Thanks !


  • Lifetime Qt Champion

    Hi,

    The information you are looking for is in the Getting Started With Qt For Androïd chapter in Qt's documentation.



  • Thank you SGaist for this information. So we can use Qt 5.15.1 with SDK 29 and NDK r21d ?

    But how to explain these warnings that tell me there is a compatibility problem with the SDK version (29) ?


  • Lifetime Qt Champion

    If it's the latest and greatest from Google, then I would go with the previous version. Each new release of the NDK has a tendency to break something for external projects using it.



  • I have a problem selecting the correct version of ndk in qtcreator 4.13.1

    I can select a version but it's always the version 21.1.6352462 that is finally used during the compilation...

    How to solve this problem ?


Log in to reply