PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV Mobile 2024 → Failure Installing Application
Failure Installing Application
Débuté par Vitor Nogueira, 08 mar. 2023 10:25 - 1 réponse
Posté le 08 mars 2023 - 10:25
Since started to use 27 version of WM, i can't make my app to update itself (after download from FTP Server).

Download completed sucessfully, and the file exists in CompleteDir(fExeDir()) + "App.apk" but the code line ShellExecute(CompleteDir(fExeDir()) + "App.apk") doesn't work on Android 10 SO.
The same code works on WM 25 and WM 26.

After adb logcat i have this:

03-07 08:29:12.458 1461 1686 I WifiClientModeImpl: fetchRssiLinkSpeedAndFrequencyNative rssi=-51 TxLinkspeed=72 freq=2462 RxLinkSpeed=72
03-07 08:29:13.783 0 0 W swapper/4: type=1400 audit(0.0:50654): avc: denied { kill } for capability=5 scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
03-07 08:29:15.484 1461 1686 I WifiClientModeImpl: fetchRssiLinkSpeedAndFrequencyNative rssi=-49 TxLinkspeed=72 freq=2462 RxLinkSpeed=72
03-07 08:29:17.053 1214 1214 W /system/vendor/bin/ipacm: type=1400 audit(0.0:50655): avc: denied { write } for comm=6E65746C696E6B20736F636B6574 name="ipacm_log_file" dev="tmpfs" ino=37073 scontext=u:r:ipacm:s0 tcontext=u:object_r:ipacm_socket:s0 tclass=sock_file permissive=0
03-07 08:29:18.510 1461 1686 I WifiClientModeImpl: fetchRssiLinkSpeedAndFrequencyNative rssi=-48 TxLinkspeed=72 freq=2462 RxLinkSpeed=72
03-07 08:29:21.137 1461 4784 E BoostFramework: BoostFramework() : Exception_1 = java.lang.NoSuchMethodException: com.qualcomm.qti.Performance.perfEvent [int, class java.lang.String, int, class [I]
03-07 08:29:21.528 1461 1686 I WifiClientModeImpl: fetchRssiLinkSpeedAndFrequencyNative rssi=-47 TxLinkspeed=72 freq=2462 RxLinkSpeed=72
03-07 08:29:22.328 7131 7131 I tupdateapp27.g: Waiting for a blocking GC Instrumentation
03-07 08:29:22.347 7131 7131 I tupdateapp27.g: WaitForGcToComplete blocked Instrumentation on ProfileSaver for 19.247ms
03-07 08:29:23.394 7131 7131 I Choreographer: Skipped 1491 frames! The application may be doing too much work on its main thread.
03-07 08:29:23.445 28919 28919 I IntentAccessibilityService: onAccessibilityEvent
03-07 08:29:23.773 0 0 W swapper/6: type=1400 audit(0.0:50663): avc: denied { kill } for capability=5 scontext=u:r:kernel:s0 tcontext=u:r:kernel:s0 tclass=capability permissive=0
03-07 08:29:23.809 7131 7131 D CompatibilityChangeReporter: Compat change id reported: 147798919; UID 10267; state: ENABLED
03-07 08:29:23.824 7131 7131 D StrictMode: StrictMode policy violation: android.os.strictmode.IncorrectContextUseViolation: Visual services, such as WindowManager, WallpaperService or LayoutInflater should be accessed from Activity or other visual Context. Use an Activity or a Context created with Context#createWindowContext(int, Bundle), which are adjusted to the configuration and visual bounds of an area on screen.
03-07 08:29:23.824 7131 7131 D StrictMode: at android.os.StrictMode.onIncorrectContextUsed(StrictMode.java:2192)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.app.ContextImpl.getSystemService(ContextImpl.java:1915)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.content.ContextWrapper.getSystemService(ContextWrapper.java:803)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.content.ContextWrapper.getSystemService(ContextWrapper.java:803)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.content.Context.getSystemService(Context.java:3706)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.widget.ToastPresenter.<init>(ToastPresenter.java:81)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.widget.Toast$TN.<init>(Toast.java:615)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.widget.Toast.<init>(Toast.java:167)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.widget.Toast.makeText(Toast.java:492)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.widget.Toast.makeText(Toast.java:480)
03-07 08:29:23.824 7131 7131 D StrictMode: at fr.pcsoft.wdjava.core.utils.WDAppUtils$APKInstallBroadcastReceiver.onReceive(Unknown Source:86)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.app.ActivityThread.handleReceiver(ActivityThread.java:4042)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.app.ActivityThread.access$1500(ActivityThread.java:241)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1940)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.os.Handler.dispatchMessage(Handler.java:106)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.os.Looper.loop(Looper.java:223)
03-07 08:29:23.824 7131 7131 D StrictMode: at android.app.ActivityThread.main(ActivityThread.java:7747)
03-07 08:29:23.824 7131 7131 D StrictMode: at java.lang.reflect.Method.invoke(Native Method)
03-07 08:29:23.824 7131 7131 D StrictMode: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
03-07 08:29:23.824 7131 7131 D StrictMode: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:952)
03-07 08:29:23.824 7131 7131 D StrictMode: Caused by: java.lang.IllegalAccessException: Tried to access visual service WindowManager from a non-visual Context:fr.pcsoft.wdjava.core.application.WDAndroidApp@4adb5df
03-07 08:29:23.824 7131 7131 D StrictMode: at android.app.ContextImpl.getSystemService(ContextImpl.java:1914)
03-07 08:29:23.824 7131 7131 D StrictMode: ... 18 more
03-07 08:29:23.835 7131 7131 E ContextImpl: Tried to access visual service WindowManager from a non-visual Context:fr.pcsoft.wdjava.core.application.WDAndroidApp@4adb5df Visual services, such as WindowManager, WallpaperService or LayoutInflater should be accessed from Activity or other visual Context. Use an Activity or a Context created with Context#createWindowContext(int, Bundle), which are adjusted to the configuration and visual bounds of an area on screen.
03-07 08:29:23.835 7131 7131 E ContextImpl: java.lang.IllegalAccessException: Tried to access visual service WindowManager from a non-visual Context:fr.pcsoft.wdjava.core.application.WDAndroidApp@4adb5df
03-07 08:29:23.835 7131 7131 E ContextImpl: at android.app.ContextImpl.getSystemService(ContextImpl.java:1914)

Can anyone help?

Thanks
Membre enregistré
797 messages
Popularité : +40 (42 votes)
Posté le 09 mars 2023 - 12:34
Hi. Look at this https://doc.windev.com/en-US/…

Android

Running an APK file setup
From Android 8, to run the setup of an APK file with ShellExecute, it is necessary to modify the permissions required by the application.
Required permission: REQUEST_INSTALL_PACKAGES.
This permission is used to install packages.
For more details (especially for previous versions of WINDEV Mobile), see FAQ 16927: What to do on Android 8 if the setup of an APK file with ShellExecute is no longer allowed?.

Do you have this permision?

Rubén