简体   繁体   English

用户10031和当前进程都没有android.permission.INSTALL_PACKAGES

[英]Neither user 10031 nor current process has android.permission.INSTALL_PACKAGES

I want to use PackageManager to install self apk, but I have some problems. 我想使用PackageManager安装自我apk,但是我有一些问题。

PackageManager pm = getPackageManager(); PackageManager pm = getPackageManager();

pm.installPackage(Uri.fromFile(file), null, PackageManager.INSTALL_REPLACE_EXISTING, pakcageName); pm.installPackage(Uri.fromFile(file),null,PackageManager.INSTALL_REPLACE_EXISTING,pakcageName);

java.lang.SecurityException: Neither user 10031 nor current process has android.permission.INSTALL_PACKAGES. java.lang.SecurityException:用户10031和当前进程都没有android.permission.INSTALL_PACKAGES。 at android.os.Parcel.readException(Parcel.java:1322) at android.os.Parcel.readException(Parcel.java:1276) at android.content.pm.IPackageManager$Stub$Proxy.installPackage(IPackageManager.java:1951) at android.app.ContextImpl$ApplicationPackageManager.installPackage(ContextImpl.java:2549) 在android.os.Parcel.readException(Parcel.java:1322)在android.os.Parcel.readException(Parcel.java:1276)在android.content.pm.IPackageManager $ Stub $ Proxy.installPackage(IPackageManager.java:1951) )在android.app.ContextImpl $ ApplicationPackageManager.installPackage(ContextImpl.java:2549)

As the error says, your app does not have permission to install packages. 如错误所示,您的应用没有安装软件包的权限。

put: 放:

<uses-permission name="android.permission.INSTALL_PACKAGES"/>

In your manifest that should get you started. 在清单中应该可以帮助您入门。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Android棒棒糖java.lang.SecurityException:用户和当前进程都没有android.permission.BLUETOOTH_PRIVILEGED - Android lollipop java.lang.SecurityException: Neither user nor current process has android.permission.BLUETOOTH_PRIVILEGED java.lang.SecurityException:需要 BLUETOOTH 权限:用户 10065 和当前进程都没有 android.permission.BLUETOOTH - java.lang.SecurityException: Need BLUETOOTH permission: Neither user 10065 nor current process has android.permission.BLUETOOTH java.lang.SecurityException:用户 11029 和当前进程都没有 android.permission.SET_TIME_ZONE - java.lang.SecurityException: Neither user 11029 nor current process has android.permission.SET_TIME_ZONE 正在获取java.lang.SecurityException:ConnectivityService:用户10062或当前进程都没有android.permission.ACCESS_NETWORK_STATE。” - Geting java.lang.SecurityException: ConnectivityService: Neither user 10062 nor current process has android.permission.ACCESS_NETWORK_STATE." JVM 异常发生:需要蓝牙权限:用户 10258 不是当前进程都没有 android.permission.Bluetooth python jnius? - JVM exception occured:Need Bluetooth permission: Neither user 10258 not current process has android.permission.Bluetooth python jnius? 子进程既不会在Windows中完成也不会中止? - Child Process will neither complete nor abort in Windows? Jgit:Bare Repository没有工作树,也没有索引 - Jgit:Bare Repository has neither a working tree, nor an index OSX 上的 sdkman 既不能安装也不能卸载 Java 1.8 - sdkman on OSX can neither install nor uninstall Java 1.8 Spring能够处理这种用例吗? 既不注入属性,也不注入构造函数 - Is Spring able to handle this user case? Neither property nor constructor injection Android安装apk而无需用户许可 - Android install apk without asking user permission
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM