应用程序安装失败

时间:2015-12-16 01:44:02

标签: android

我正在尝试编写我的第一个Android应用程序,我已经设法测试它并在运行Android 4.4的平板电脑上进行调试,但我无法在运行Android 5.1.1的手机上运行它 我用谷歌搜索了它,但我找不到任何解决方案..我已经下载了A-L-L SDK文件(花了我大约60 GB)但仍然没有任何作用.. 主要错误是:

enter image description here

在运行控制台上它说:

    pkg: /data/local/tmp/yarden4.myappsname
Error: java.lang.SecurityException: Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.

这是一个logcat裁剪到我尝试运行的特定时间:

12-16 03:19:16.543 16411-16411/? D/AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
12-16 03:19:16.547 16411-16411/? D/AndroidRuntime: CheckJNI is OFF
12-16 03:19:16.653 16411-16411/? D/AndroidRuntime: Calling main entry com.android.commands.pm.Pm
12-16 03:19:16.660 16411-16411/? E/Pm: Error
                                       java.lang.SecurityException: Neither user 2000 nor current process has android.permission.INSTALL_PACKAGES.
                                           at android.os.Parcel.readException(Parcel.java:1553)
                                           at android.os.Parcel.readException(Parcel.java:1505)
                                           at android.content.pm.IPackageManager$Stub$Proxy.installPackageAsUser(IPackageManager.java:3033)
                                           at com.android.commands.pm.Pm.runInstall(Pm.java:958)
                                           at com.android.commands.pm.Pm.run(Pm.java:143)
                                           at com.android.commands.pm.Pm.main(Pm.java:101)
                                           at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
                                           at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:249)
12-16 03:19:16.662 16411-16411/? I/art: System.exit called, status: 1
12-16 03:19:16.662 16411-16411/? I/AndroidRuntime: VM exiting with result code 1.

我也试过:重新安装android studio /搜索我的手机上安装的应用程序(它也不在应用程序列表中,也不在数据/应用程序文件夹中)/搞乱谷歌播放服务应用程序.. /试过不同的应用程序..甚至一个干净整洁的你好世界将不会运行..我会再次提到..它在我的平板电脑上工作正常。

P.S我的手机和平板电脑是root + + xpos +非原装ROM(两者)

知道该怎么办?我被这件事困住了几天.. :(

非常感谢ALOT!

2 个答案:

答案 0 :(得分:0)

您可以在Android manifest文件

中的权限中添加以下行
<uses-permission android:name="android.permission.INSTALL_PACKAGES" /> 

如果问题仍然存在: - 清洁和重建 - 检查您的手机是否未关闭某些权限

如果上述解决方案均无效,您最终可以查看此链接: Permission is only granted to system app

答案 1 :(得分:0)

如果您在这里是因为您重命名了项目目录并收到以下错误:

enter image description here

解决方案是简单地转到菜单&gt;构建&gt;清洁项目。然后,单击运行应用程序(绿色箭头)。

这将迫使项目清理app/build的那些构建,我认为这会导致问题。

相关问题