安装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)的更多相关文章

  1. 安装APK报错解决方法【转】

    本文转载自:http://blog.csdn.net/zy1235678/article/details/38122827 adb install xxx.apk 报错,安装APK报错:INSTALL ...

  2. 安装APK时报错:Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI]

    安装APK时报错:Failure [INSTALL_FAILED_TEST_ONLY: installPackageLI] 可以使用adb install -t 解决 对于已经在手机的文件可以使用pm ...

  3. 我的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 ...

  4. 小米手机_adb安装apk报错”Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]“

    问题: adb安装apk至小米手机时,安装失败,报错提示“Failure [INSTALL_FAILED_USER_RESTRICTED: Install canceled by user]”,如下图 ...

  5. Android N安装apk报错:android.os.FileUriExposedException

    StackOverflow: http://stackoverflow.com/questions/38200282/android-os-fileuriexposedexception-file-s ...

  6. adb 安装apk 报错:Failure [INSTALL_FAILED_ALREADY_EXISTS]

    遇到INSTALL_FAILED_ALREADY_EXISTS问题,直接通过adb install -r xxx.apk命令安装apk即可

  7. Android 7.0系统代码调用安装apk时报错FileUriExposedException完美解决

    项目更新遇到问题   Android项目开发中经常遇到下载更新的需求,以前调用系统安装器执行安装操作代码如下: Intent intent = new Intent(); intent.setActi ...

  8. adb 安装apk 报错:Failure [INSTALL_FAILED_INVALID_URI]

    今天在安装某apk的时候,发现报错 报错信息:Failure [INSTALL_FAILED_INVALID_URI] 于是找到了一个解决方式: cmd命令行下执行以下命令: 第一步.adb remo ...

  9. 解决Android Studio编译后安装apk报错:Error while Installing APK

    刚开始玩 Android ,用Android studio  连接真机做测试,在虚拟机上没有问题,但是真机就会报错 检查了好多地方,最终发现了问题,网上的常规就不介绍了,大家自己去看别的帖子 手机方面 ...

随机推荐

  1. 内存对齐与ANSI C中struct型数据的内存布局 【转】

    转自:http://blog.chinaunix.net/uid-25909619-id-3032209.html 当在C中定义了一个结构类型时,它的大小是否等于各字段(field)大小之和?编译器将 ...

  2. mysql-8.0.11-winx64 免安装版配置方法

    mysql-8.0.11-winx64.zip  下载地址:https://dev.mysql.com/downloads/file/?id=476233 mysql-8.0.11-winx64.zi ...

  3. The project cannot be built until its prerequisite base-service is built. Cleaning and building all projects is recommended

    参考网址:http://chiangfai.iteye.com/blog/2223661,谢谢! 果然如文中所述,close,重新编译即可!

  4. jq选择子元素

    jq选择子元素 一.获取父级元素 1. parent([expr]): 获取指定元素的所有父级元素 <div id="par_div"><a id="h ...

  5. Grinder搭建小记与Nduja(这次不待续了)

    Grinder是比较有名的浏览器FUZZ框架,采用ruby语言编写,主要是作为测试框架来使用,在<白帽子讲浏览器安全>一书中作者使用了Nduja生成测试样本来配合Grinder使用.根据网 ...

  6. Intellij IDEA Debug调试技巧

    1.这里以一个web工程为例,点击图中按钮开始运行web工程. 2.设置断点 3.使用postman发送http请求 4.请求发送之后会自动跳到断点处,并且在断点之前会有数据结果显示 5.按F8 在 ...

  7. hdu 5428 质因子

    问题描述有一个数列,FancyCoder沉迷于研究这个数列的乘积相关问题,但是它们的乘积往往非常大.幸运的是,FancyCoder只需要找到这个巨大乘积的最小的满足如下规则的因子:这个因子包含大于两个 ...

  8. [转] 钉钉的H5性能优化方案

    对于一个H5的产品,功能无疑很重要,但是性能同样是用户体验中不可或缺的一环.原本H5的渲染性能就不及native的app,如果不把性能优化做起来,将极大地影响用户使用产品的积极性. 用户感受 当用户能 ...

  9. 037 SparkSQL ThriftServer服务的使用和程序中JDBC的连接

    一:使用 1.实质 提供JDBC/ODBC连接的服务 服务运行方式是一个Spark的应用程序,只是这个应用程序支持JDBC/ODBC的连接, 所以:可以通过应用的4040页面来进行查看操作 2.启动服 ...

  10. Pandas常用命令

    一.数据导入和导出 (一)读取csv文件 1.本地读取 import pandas as pd df = pd.read_csv('tips.csv') #根据自己数据文件保存的路径填写(p.s. p ...