安装APK的错误码(PackageManager.java)
安装APK的错误码,定义在android源码中的这个文件中:
frameworks\base\core\java\android\content\pm\PackageManager.java
/**
* if the package is already installed.
* 程序已经存在
*/
public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; /**
* if the package archive file is invalid.
* 无效的APK
*/
public static final int INSTALL_FAILED_INVALID_APK = -2; /**
* if the URI passed in is invalid.
* 无效的链接
*/
public static final int INSTALL_FAILED_INVALID_URI = -3; /**
* if the package manager service found that the device
* didn't have enough storage space to install the app.
* 没有足够的存储空间
*/
public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; /**
* if a package is already installed with the same name.
* 已存在同名程序
*/
public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; /**
* if the requested shared user does not exist.
* 共享用户不存在
*/
public static final int INSTALL_FAILED_NO_SHARED_USER = -6; /**
* if a previously installed package of the same name has a different signature
* than the new package (and the old package's data was not removed).
* 更新不兼容
*/
public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; /**
* if the new package is requested a shared user which is already installed
* on the device and does not have matching signature.
* 共享用户不兼容
*/
public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; /**
* if the new package uses a shared library that is not available.
* 共享库已丢失
*/
public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; /**
* if the new package uses a shared library that is not available.
* 替换时无法删除
*/
public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; /**
* if the new package failed while optimizing and validating its dex files,
* either because there was not enough storage or the validation failed.
* 空间不足或验证失败
*/
public static final int INSTALL_FAILED_DEXOPT = -11; /**
* if the new package failed because the current SDK version is older than
* that required by the package.
* 系统版本过旧
*/
public static final int INSTALL_FAILED_OLDER_SDK = -12; /**
* if the new package failed because it contains a content provider with the
* same authority as a provider already installed in the system.
* 存在同名的内容提供者
*/
public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; /**
* if the new package failed because the current SDK version is newer than
* that required by the package.
* 系统版本过新
*/
public static final int INSTALL_FAILED_NEWER_SDK = -14; /**
* if the new package failed because it has specified that it is a test-only
* package and the caller has not supplied the {@link #INSTALL_ALLOW_TEST}
* flag.
* 调用者不被允许测试的测试程序
*/
public static final int INSTALL_FAILED_TEST_ONLY = -15; /**
* if the package being installed contains native code, but none that is
* compatible with the the device's CPU_ABI.
* 包含的本机代码不兼容CPU_ABI
*/
public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; /**
* if the new package uses a feature that is not available.
* 使用了一个无效的特性
*/
public static final int INSTALL_FAILED_MISSING_FEATURE = -17; // ------ Errors related to sdcard
/**
* if a secure container mount point couldn't be accessed on external media.
* SD卡访问失败
*/
public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; /**
* if the new package couldn't be installed in the specified install location.
* 无效的安装路径
*/
public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; /**
* if the new package couldn't be installed in the specified install
* location because the media is not available.
* SD卡不可用
*/
public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; /**
* if the new package couldn't be installed because the verification timed out.
* 验证超时
*/
public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; /**
* if the new package couldn't be installed because the verification did not succeed.
* 验证失败
*/
public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; /**
* if the package changed from what the calling program expected.
* 预期的应用被改变
*/
public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; /**
* if the parser was given a path that is not a file, or does not end
* with the expected '.apk' extension.
* 解析失败,不是APK
*/
public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; /**
* if the parser was unable to retrieve the AndroidManifest.xml file.
* 解析失败,无法提取Manifest
*/
public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; /**
* if the parser encountered an unexpected exception.
* 解析失败,无法预期的异常
*/
public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; /**
* if the parser did not find any certificates in the .apk.
* 解析失败,找不到证书
*/
public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; /**
* if the parser found inconsistent certificates on the files in the .apk.
* 解析失败,证书不一致
*/
public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; /**
* if the parser encountered a CertificateEncodingException in one of the
* files in the .apk.
* 解析失败,证书编码异常
*/
public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; /**
* if the parser encountered a bad or missing package name in the manifest.
* 解析失败,manifest中的包名错误或丢失
*/
public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; /**
* if the parser encountered a bad shared user id name in the manifest.
* 解析失败,manifest中的共享用户错误
*/
public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; /**
* if the parser encountered some structural problem in the manifest.
* 解析失败,manifest中出现结构性错误
*/
public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; /**
* if the parser did not find any actionable tags (instrumentation or application)
* in the manifest.
* 解析失败,manifest中没有actionable tags
*/
public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; /**
* if the system failed to install the package because of system issues.
* 系统问题导致安装失败
*/
public static final int INSTALL_FAILED_INTERNAL_ERROR = -110;
/** * if the package is already installed. * 程序已经存在 */public static final int INSTALL_FAILED_ALREADY_EXISTS = -1;
/** * if the package archive file is invalid. * 无效的APK */public static final int INSTALL_FAILED_INVALID_APK = -2;
/** * if the URI passed in is invalid. * 无效的链接 */public static final int INSTALL_FAILED_INVALID_URI = -3;
/** * if the package manager service found that the device * didn't have enough storage space to install the app. * 没有足够的存储空间 */public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4;
/** * if a package is already installed with the same name. * 已存在同名程序 */public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5;
/** * if the requested shared user does not exist. * 共享用户不存在 */public static final int INSTALL_FAILED_NO_SHARED_USER = -6;
/** * if a previously installed package of the same name has a different signature * than the new package (and the old package's data was not removed). * 更新不兼容 */public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7;
/** * if the new package is requested a shared user which is already installed * on the device and does not have matching signature. * 共享用户不兼容 */public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8;
/** * if the new package uses a shared library that is not available. * 共享库已丢失 */public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9;
/** * if the new package uses a shared library that is not available. * 替换时无法删除 */public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10;
/** * if the new package failed while optimizing and validating its dex files, * either because there was not enough storage or the validation failed. * 空间不足或验证失败 */public static final int INSTALL_FAILED_DEXOPT = -11;
/** * if the new package failed because the current SDK version is older than * that required by the package. * 系统版本过旧 */public static final int INSTALL_FAILED_OLDER_SDK = -12;
/** * if the new package failed because it contains a content provider with the * same authority as a provider already installed in the system. * 存在同名的内容提供者 */public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13;
/** * if the new package failed because the current SDK version is newer than * that required by the package. * 系统版本过新 */public static final int INSTALL_FAILED_NEWER_SDK = -14;
/** * if the new package failed because it has specified that it is a test-only * package and the caller has not supplied the {@link #INSTALL_ALLOW_TEST} * flag. * 调用者不被允许测试的测试程序 */public static final int INSTALL_FAILED_TEST_ONLY = -15;
/** * if the package being installed contains native code, but none that is * compatible with the the device's CPU_ABI. * 包含的本机代码不兼容CPU_ABI */public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16;
/** * if the new package uses a feature that is not available. * 使用了一个无效的特性 */public static final int INSTALL_FAILED_MISSING_FEATURE = -17;
// ------ Errors related to sdcard/** * if a secure container mount point couldn't be accessed on external media. * SD卡访问失败 */public static final int INSTALL_FAILED_CONTAINER_ERROR = -18;
/** * if the new package couldn't be installed in the specified install location. * 无效的安装路径 */public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19;
/** * if the new package couldn't be installed in the specified install * location because the media is not available. * SD卡不可用 */public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20;
/** * if the new package couldn't be installed because the verification timed out. * 验证超时 */public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21;
/** * if the new package couldn't be installed because the verification did not succeed. * 验证失败 */public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22;
/** * if the package changed from what the calling program expected. * 预期的应用被改变 */public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23;
/** * if the parser was given a path that is not a file, or does not end * with the expected '.apk' extension. * 解析失败,不是APK */public static final int INSTALL_PARSE_FAILED_NOT_APK = -100;
/** * if the parser was unable to retrieve the AndroidManifest.xml file. * 解析失败,无法提取Manifest */public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101;
/** * if the parser encountered an unexpected exception. * 解析失败,无法预期的异常 */public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102;
/** * if the parser did not find any certificates in the .apk. * 解析失败,找不到证书 */public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103;
/** * if the parser found inconsistent certificates on the files in the .apk. * 解析失败,证书不一致 */public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104;
/** * if the parser encountered a CertificateEncodingException in one of the * files in the .apk. * 解析失败,证书编码异常 */public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105;
/** * if the parser encountered a bad or missing package name in the manifest. * 解析失败,manifest中的包名错误或丢失 */public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106;
/** * if the parser encountered a bad shared user id name in the manifest. * 解析失败,manifest中的共享用户错误 */public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107;
/** * if the parser encountered some structural problem in the manifest. * 解析失败,manifest中出现结构性错误 */public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108;
/** * if the parser did not find any actionable tags (instrumentation or application) * in the manifest. * 解析失败,manifest中没有actionable tags */public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109;
/** * if the system failed to install the package because of system issues. * 系统问题导致安装失败 */public static final int INSTALL_FAILED_INTERNAL_ERROR = -110;
安装APK的错误码(PackageManager.java)的更多相关文章
- 安装APK报错解决方法【转】
本文转载自:http://blog.csdn.net/zy1235678/article/details/38122827 adb install xxx.apk 报错,安装APK报错:INSTALL ...
- 安装APK时报错:Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]
安装APK时报错:Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] 可以使用adb install -t 解决 对于已经在手机的文件可以使用pm ...
- 我的Android进阶之旅------>解决Android Studio编译后安装apk报错:The APK file does not exist on disk
1.错误描述 今天用Android Studio编译应用后安装APK的时候,报错了,错误如下所示: The APK file build\outputs\apk\OYP_2.3.4_I2Base_64 ...
- 小米手机_adb安装apk报错”Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]“
问题: adb安装apk至小米手机时,安装失败,报错提示“Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]”,如下图 ...
- Android N安装apk报错:android.os.FileUriExposedException
StackOverflow: http://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-s ...
- adb 安装apk 报错:Failure [INSTALL_FAILED_ALREADY_EXISTS]
遇到INSTALL_FAILED_ALREADY_EXISTS问题,直接通过adb install -r xxx.apk命令安装apk即可
- Android 7.0系统代码调用安装apk时报错FileUriExposedException完美解决
项目更新遇到问题 Android项目开发中经常遇到下载更新的需求,以前调用系统安装器执行安装操作代码如下: Intent intent = new Intent(); intent.setActi ...
- adb 安装apk 报错:Failure [INSTALL_FAILED_INVALID_URI]
今天在安装某apk的时候,发现报错 报错信息:Failure [INSTALL_FAILED_INVALID_URI] 于是找到了一个解决方式: cmd命令行下执行以下命令: 第一步.adb remo ...
- 解决Android Studio编译后安装apk报错:Error while Installing APK
刚开始玩 Android ,用Android studio 连接真机做测试,在虚拟机上没有问题,但是真机就会报错 检查了好多地方,最终发现了问题,网上的常规就不介绍了,大家自己去看别的帖子 手机方面 ...
随机推荐
- BAT修改文本内容
@echo off (for /f "delims=" %%a in (文件名) do ( set "str=%%a" setlocal enabledelay ...
- C#使用WSDL服务总结
站在巨人肩上才能看的更远! 1.C# 利用VS自带的WSDL工具生成WebService服务类 2.C#使用WSDL服务
- Android 应用安全风险与防范
代码混淆 Android开发除了部分功能采用C/C++编码外,其余主要都是采用Java进行编码开发功能.Java应用非常容易被反编译,Android自然也不例外.只要利用apktool等类似的反编译工 ...
- JQ实现弹幕效果
JQ实现弹幕效果,快来吐糟你的想法吧 效果图: 代码如下,复制即可使用: <!DOCTYPE html> <html> <head> <meta charse ...
- ***Bootstrap FileInput插件的使用经验汇总
插件下载地址: https://github.com/kartik-v/bootstrap-fileinput/ 官方DEMO查看: http://plugins.krajee.com/file-ba ...
- vuejs递归组件
vuejs学习--递归组件 前言 学习vue有一段时间了,最近使用vue做了一套后台管理系统,其中使用最多就是递归组件,也因为自己对官方文档的不熟悉使得自己踩了不少坑,今天写出来和大家一起分享. ...
- 添加用户到LDAP服务器
1. 在浏览器中打开http://ldap.example.com/phpldapadmin 2. 点击[login]链接,输入管理员密码. 3. 点击[Create a new entry her ...
- 【Java】 大话数据结构(12) 查找算法(3) (平衡二叉树(AVL树))
本文根据<大话数据结构>一书及网络资料,实现了Java版的平衡二叉树(AVL树). 平衡二叉树介绍 在上篇博客中所实现的二叉排序树(二叉搜索树),其查找性能取决于二叉排序树的形状,当二叉排 ...
- 应用Mongoose开发MongoDB(3)控制器(controllers)
控制器的基本构成与如何通过路由调用 控制器中通过建立函数并导出,实现前端对数据库的查询.新建.删除与修改的需求,并使之可以在路由中调用,完成API的封装.本文着重于结构之间的关系,具体问题解决方法将在 ...
- 400+节点的 Elasticsearch 集群运维
本文首发于InfoQ https://www.infoq.cn/article/1sm0Mq5LyY_021HGuXer 作者:Anton Hägerstrand 翻译:杨振涛 目录: 数据量 版本 ...