安装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 连接真机做测试,在虚拟机上没有问题,但是真机就会报错 检查了好多地方,最终发现了问题,网上的常规就不介绍了,大家自己去看别的帖子 手机方面 ...
随机推荐
- 【Hadoop】搭建完全分布式的hadoop【转】
转自:http://www.cnblogs.com/laov/p/3421479.html 下面博文已更新,请移步 ↑ 用于测试,我用4台虚拟机搭建成了hadoop结构 我用了两个台式机.一个xp系统 ...
- C#排队处理DEMO
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- Oracle 数据库和监听器开机自启动两种实现方法
数据库和监听器开机自启动 编辑oratab文件: 修改:orcl:/u01/app/oracle/product/11.2.0/db_1:N orcl:/u01/app/or ...
- Chrome插件 postman的使用方法详解!最全面的教程
一 简介 Postman 是一款功能超级强大的用于发送 HTTP 请求的 Chrome插件 .做web页面开发和测试的人员应该是无人不晓无人不用!其主要特点 特点: 创建 + 测试:创建和发送任何的H ...
- Batch Normalization 与 Caffe中的 相关layer
在机器学习领域,通常假设训练数据与测试数据是同分布的,BatchNorm的作用就是深度神经网络训练过程中, 使得每层神经网络的输入保持同分布. 原因:随着深度神经网络层数的增加,训练越来越困难,收敛越 ...
- wpf 查找children的方法
var newValue = (bool)args.NewValue; HZWaitLoadingEx source = (HZWaitLoadingEx)sender; ControlTemplat ...
- 阿里云服务器配置nginx和PHP
1. 安装及启动nginx 输入yum install nginx命令进行nginx的安装,当需要确认时输入”y“确认. yum install nginx 安装完成后,输入service nginx ...
- 和为k的最长子数组及其延伸
问题1: /** * 问题描述: * 给定一个无序数组arr,其中元素可正.可负.可0, * 求arr所有的子数组中正数与负数个数相等的最长子数组长度 * * 解题思路:对数组进行处理,正数为1,负数 ...
- pathon 基础学习-集合(set),单双队列,深浅copy,内置函数
一.collections系列: collections其实是python的标准库,也就是python的一个内置模块,因此使用之前导入一下collections模块即可,collections在pyt ...
- SQL Server 3
一.数据压缩 1.行压缩 行压缩可将固定长度类型存储为可变长度存储类型.例如,使用char(100)数据列存储字符串“SQL Server 2012”,压缩后只需要存放15个字符.(这种压缩模式,将对 ...