API issues with Xiaomi MI 8



  • Using a brand new Xiaomi MI8 for testing for a couple of days. After a MIUI update this morning I have follwoing issue when starting Qt based applications:
    0_1549614720019_Screenshot_2019-02-08-09-18-37-022.png
    This is a test with the notification example of Qt.Despite the warning the application seem to run without further issues. The screen pops up immediately after start of the application. The same with another more complex application.
    0_1549615026158_Screenshot_2019-02-08-09-35-54-054_com.android.settings.png


  • Moderators

    @koahnig
    can you please provide the logcat

    # First clear the existing logcat messages
    adb logcat -c
    
    # Then reproduce the issue and save the logcat messages to a file
    adb logcat -d > logcat.txt
    

    also to make sure: you are trying to run an unchanged Notification example?


  • Moderators

    @koahnig is this with your 5.12.1 setup or your 5.11.3 ?
    I'm asking because of ndk, sdk and linked jdk version.



  • @J.Hilk
    This is with Qt5.11.3

    0_1549618447630_1a115280-61d6-41fd-b19c-0319e5d455c7-image.png

    @raven-worx
    The example was slightly modified, since of a compile error with the original source. Unfortunately, I have copied over the running code and cannot recompile right away. Need to restore compilable code.



  • @raven-worx

    I have restored the original example code of Qt5.11.3. Previously mentioned compile error was due to a change which slipped through when checking.

    Here is the dump as requested (first few lines only). Do you need the complete dump?
    It is rather "big", at least for posting. I can provide it through a link.

    --------- beginning of main
    02-08 11:03:31.028 23264 23312 D ClClient: Not sending keepalive.  Current connection state=STOPPED
    02-08 11:03:33.077   703  3062 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xa
    02-08 11:03:33.085  3014  3014 I wpa_supplicant: wlan0: CTRL-EVENT-AVOID-FREQ ranges=
    02-08 11:03:41.053 23264 23312 D ClClient: Not sending keepalive.  Current connection state=STOPPED
    02-08 11:03:44.104   703  3062 I WifiHAL : event received NL80211_CMD_VENDOR, vendor_id = 0x1374, subcmd = 0xa
    02-08 11:03:44.109  3014  3014 I wpa_supplicant: wlan0: CTRL-EVENT-AVOID-FREQ ranges=5500-5640
    02-08 11:03:44.558  1556  1556 W Binder:1556_19: type=1400 audit(0.0:7731): avc: denied { sigstop } for scontext=u:r:system_server:s0 tcontext=u:r:untrusted_app_27:s0:c512,c768 tclass=process permissive=0
    --------- beginning of system
    02-08 11:03:44.567  1556  4867 I ActivityManager: Force stopping org.qtproject.example.notification appid=10166 user=0: from process:29970
    02-08 11:03:44.568  1556  4867 I AutoStartManagerService: MIUILOG- Reject RestartService packageName :org.qtproject.example.notification uid : 10166
    02-08 11:03:44.569  1556  4867 D AutoStartManagerService: prepare force stop 29626
    02-08 11:03:44.569  1556  4867 I Process : Sending signal. PID: 29626 SIG: 19
    02-08 11:03:44.570  1556  4867 I ActivityManager: Killing 29626:org.qtproject.example.notification/u0a166 (adj 700): stop org.qtproject.example.notification: from process:29970
    02-08 11:03:44.572  3915  4320 D PowerKeeper.Event: notifyActiveKilled processName: org.qtproject.example.notification, pid:29626, reason:stop org.qtproject.example.notification: from process:29970
    

  • Moderators

    @koahnig
    so the error message comes from those:

    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->ViewDrawableStates:[I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_background:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_padding:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_paddingLeft:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_paddingTop:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_paddingRight:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_paddingBottom:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_scrollX:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_scrollY:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_id:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_tag:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_fitsSystemWindows:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_focusable:I (light greylist, reflection)
    02-08 11:14:47.427 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_focusableInTouchMode:I (light greylist, reflection)
    02-08 11:14:47.428 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_clickable:I (light greylist, reflection)
    02-08 11:14:47.428 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_longClickable:I (light greylist, reflection)
    02-08 11:14:47.428 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_saveEnabled:I (light greylist, reflection)
    02-08 11:14:47.428 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_duplicateParentState:I (light greylist, reflection)
    02-08 11:14:47.428 32250 32250 W le.notificatio: Accessing hidden field Landroid/R$styleable;->View_visibility:I (light greylist, reflection)
    
    ....
    and many more
    

    I will check later, when i have time.


  • Moderators

    @koahnig
    I don't have an Android 9 device to test with, but I know that one of my apps is running on a Mate 20Pro that should be the newest OS, without any issue.

    It's made with Qt5.12.1 and ndk r18b, so it may be an outdated NDK version ?



  • @J.Hilk

    This is NDK r10e

    Therefore, you might be right that it is the NDK version. I am going to test Qt5.12. later. This requires a newer NDK anyhow.



  • @raven-worx

    Take your time. It seems to work.

    @J-Hilk @raven-worx

    Thought that I noted before that restarting the app directly on phone does not show message. Therefore, I did some testing.
    Starting through creator brings up message. Restarting from phone does NOT.
    Rebuild application and NOT starting through creator, but deployment to device. Starting on phone directly --> No Message.


  • Moderators

    @koahnig said in API issues with Xiaomi MI 8:

    Thought that I noted before that restarting the app directly on phone does not show message. Therefore, I did some testing.
    Starting through creator brings up message. Restarting from phone does NOT.
    Rebuild application and NOT starting through creator, but deployment to device. Starting on phone directly --> No Message.

    Uh, than It may be related to this
    https://bugreports.qt.io/browse/QTCREATORBUG-21389

    The debug support is sorely depending in the OEM so an update on your device may cause the run-as command not to behave as it previously did.



  • @J.Hilk

    I think it may be a different issue.

    First of all the message appears for debug and release compilation.
    Second, the applications are started Ctrl+r (run) in creator.
    Third, I have issues with debugging F5 anyhow. See https://forum.qt.io/topic/98729/debugging-on-physical-android-device-gives-error-code

    I can debug with older device(s) respectively Android versions. 5.1 on a Google tablet it works, but Huawei P10 Android 8.0 and Xiaomi MI8 Android 9 cannot be used for debugging.
    However, any version running through Ctrl+r provides output to Application window. Therefore qDebug(), print statements and Log are the means for debugging.

    Wanna be back to the future ;)


  • Moderators

    @koahnig
    there is also another thread regarding this.
    Seems this is heavily dependent on the OEM and their customized Android or at least most manufacturers are hiding the popup by default?
    But anyway sooner or later this will become a problem for all Qt Android apps: https://developer.android.com/about/versions/pie/restrictions-non-sdk-interfaces

    What API level are you actually targeting?



  • @raven-worx

    Target API is 26, 24 might be ok too.



  • I just found I have the same problem too, are there any news about this thread?



  • @davidesalvetti

    Not from my side. I am still using Qt5.11.3 with 0_1550567338922_26e150ea-c2be-4110-8950-fadea60005be-image.png
    The message is only displayed on phone when starting from qt creator. When theapp is started from phone the very same app does not display the message anymore.

    So far I consider this as a nuisance, but forunately without effect on the performance of the app itself. I am more bothered that the debugging does not work as with older Android versions.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.