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:
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.
-
@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?
-
@J.Hilk
This is with Qt5.11.3@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. -
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
-
@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.
-
@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 ?
-
Take your time. It seems to work.
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. -
@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-21389The 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. -
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-codeI 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 ;)
-
@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-interfacesWhat API level are you actually targeting?
-
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?
-
Not from my side. I am still using Qt5.11.3 with
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.
-
@davidesalvetti I also got this from Xiaomi A2 Lite, OS 9, but it went away after setting Target SDK to API 28
-
I have updated Qt to version 5.12.1 and IIRC never seen the message again.
Therefore, I have checked and went back to target API level 24 and the message pops up again. Going back to API level 28, the message is coming anymore. I will stay so far with Qt 5.12.1