android报错

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了android报错相关的知识,希望对你有一定的参考价值。

01-12 16:03:17.265: ERROR/androidRuntime(5541): FATAL EXCEPTION: Thread-10
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): java.lang.SecurityException: Neither user 10045 nor current process has android.permission.DELETE_PACKAGES.
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): at android.os.Parcel.readException(Parcel.java:1322)
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): at android.os.Parcel.readException(Parcel.java:1276)
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): at android.content.pm.IPackageManager$Stub$Proxy.deletePackage(IPackageManager.java:2076)
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): at android.app.ContextImpl$ApplicationPackageManager.deletePackage(ContextImpl.java:2640)
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): at com.smit.packageinstaller.uninstallbatch.BatchUninstallThread.uninstallBatch(BatchUninstallThread.java:107)
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): at com.smit.packageinstaller.uninstallbatch.BatchUninstallThread.run(BatchUninstallThread.java:138)
01-12 16:03:17.265: ERROR/AndroidRuntime(5541): at java.lang.Thread.run(Thread.java:1019)
01-12 16:03:17.272: WARN/ActivityManager(4880): Force finishing activity com.smit.packageinstaller/.uninstallbatch.BatchUninstallActivity
01-12 16:03:17.507: ERROR/WindowManager(5541): Activity com.smit.packageinstaller.uninstallbatch.BatchUninstallActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40568ab8 that was originally added here
01-12 16:03:17.507: ERROR/WindowManager(5541): android.view.WindowLeaked: Activity com.smit.packageinstaller.uninstallbatch.BatchUninstallActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@40568ab8 that was originally added here
01-12 16:03:17.507: ERROR/WindowManager(5541): at android.view.ViewRoot.<init>(ViewRoot.java:259)
01-12 16:03:17.507: ERROR/WindowManager(5541): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
01-12 16:03:17.507: ERROR/WindowManager(5541): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
01-12 16:03:17.507: ERROR/WindowManager(5541): at android.view.Window$LocalWindowManager.addView(Window.java:465)
01-12 16:03:17.507: ERROR/WindowManager(5541): at android.app.Dialog.show(Dialog.java:241)
01-12 16:03:17.507: ERROR/WindowManager(5541): at android.app.ProgressDialog.show(ProgressDialog.java:107)

参考技术A android.permission.DELETE_PACKAGES卸载程序 需要权限追问

我做的就是批量卸载,要加的权限我都加了,不知道为什么还报这个错,找不到

追答

估计是批量卸载的问题,android,我们写的程序只是调用的系统的程序,批量卸载的话应该也是要一个一个的确定吧, 类似startActivityForResult(intent, 0); 删除一个成功的话获得一个requestCode,然后继续卸载其他的, 我学android一个多月,很多还不懂,胡说八道请见谅

本回答被提问者和网友采纳
参考技术B 你没有在AndroidManifest.xml 这个文件中添加操作权限,所以有些操作是不能进行的
权限如下:
<uses-permission android:name="android.permission.DELETE_PACKAGES" />追问

这个权限我加过的

参考技术C 在你得配置文件中加DELETE_PACKAGES这个权限追问

为什么不能加这个权限呢??

参考技术D

以上是关于android报错的主要内容,如果未能解决你的问题,请参考以下文章

android 调用Integer.parseInt()报错

android报错

android 启动报错

Android studio 报错问题

android开发的报错提示:android.os.NetworkOnMainThreadException

Android SD卡升级报错解决