uni-app(2.6.16) ->选择uni-app项目(默认模板)->云打包(使用公测证书)->选择打自定义基座->->打包成功->运行到手机->选择自定义调试基座->运行->提示(安装自定义基座App失败)->手动安装自定义基座->在此运行->提示(删除基座,重新安装)->有提示(安装自定义基座App失败)
- 发布:2020-05-18 10:06
- 更新:2020-10-16 11:32
- 阅读:4109
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win7
HBuilderX类型: 正式
HBuilderX版本号: 2.6.16
手机系统: Android
手机系统版本号: Android 9.0
手机厂商: 小米
手机机型: MIX2
页面类型: vue
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
成功安装自定义基座
成功安装自定义基座
实际结果:
无法安装自定义基座
无法安装自定义基座
bug描述:
选择自定义调试基座->运行->提示(安装自定义基座App失败)->手动安装自定义基座->在此运行->提示(删除基座,重新安装)->有提示(安装自定义基座App失败)->死循环了
目前 小米手机手机(MIUI11.0.5)都出现了该问题。
1.排除了代码问题
2.uni-app新建的空白项目,安装自定义基座也失败了。
3.打包没问题
人马舜521 - 相信自己
本人也遇到了这个问题,几经折腾解决办法如下:
1.根据控制台报错信息,System server has no access to read file ,没有权限;
2.检查确认Android手机设置中USB调试模式是否已开启。如果已经开启,重点确认下USB安装是否允许。
(备注:USB调试模式一般在【设置】【开发者选项】里,开发者选项如何开启请自行百度)
20:03:11.259 3035 KB/s (44841592 bytes in 14.424s)
20:03:11.361 avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=0
20:03:11.381 System server has no access to read file context u:object_r:sdcardfs:s0 (from path /sdcard/android_debug.apk, context u:r:system_server:s0)
20:03:11.402 Error: Unable to open file: /sdcard/android_debug.apk
20:03:11.421 Consider using a file under /data/local/tmp/
20:03:11.442 Error: Can't open file: /sdcard/android_debug.apk
20:03:11.462 Exception occurred while executing:
20:03:11.482 java.lang.IllegalArgumentException: Error: Can't open file: /sdcard/android_debug.apk
20:03:11.502 at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:328)
20:03:11.522 at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:906)
20:03:11.542 at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
20:03:11.562 at android.os.ShellCommand.exec(ShellCommand.java:103)
20:03:11.582 at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21911)
20:03:11.603 at android.os.Binder.shellCommand(Binder.java:629)
20:03:11.623 at android.os.Binder.onTransact(Binder.java:527)
20:03:11.643 at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2809)
20:03:11.664 at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4017)
20:03:11.684 at android.os.Binder.execTransact(Binder.java:726)
20:03:11.705 3100 KB/s (44841592 bytes in 14.122s)
20:03:44.551 2943 KB/s (44841592 bytes in 14.874s)
20:03:44.652 avc: denied { read } for scontext=u:r:system_server:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=0
20:03:44.672 System server has no access to read file context u:object_r:sdcardfs:s0 (from path /sdcard/android_debug.apk, context u:r:system_server:s0)
20:03:44.693 Error: Unable to open file: /sdcard/android_debug.apk
20:03:44.713 Consider using a file under /data/local/tmp/
20:03:44.733 Error: Can't open file: /sdcard/android_debug.apk
20:03:44.754 Exception occurred while executing:
20:03:44.775 java.lang.IllegalArgumentException: Error: Can't open file: /sdcard/android_debug.apk
20:03:44.795 at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:328)
20:03:44.815 at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:906)
20:03:44.835 at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
20:03:44.856 at android.os.ShellCommand.exec(ShellCommand.java:103)
20:03:44.876 at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:21911)
20:03:44.897 at android.os.Binder.shellCommand(Binder.java:629)
20:03:44.917 at android.os.Binder.onTransact(Binder.java:527)
20:03:44.937 at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2809)
20:03:44.958 at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4017)
20:03:44.978 at android.os.Binder.execTransact(Binder.java:726)
20:03:44.998 2979 KB/s (44841592 bytes in 14.696s)
20:03:45.018 安装自定义基座App失败,请使用手机助手手动安装E:\work-space\iot-uniapp\unpackage\debug\android_debug.apk到手机上,并重新运行真机调试。
p***@sina.com
需要有卡才能打开usb安装
2022-07-13 17:13