安装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. C# IEqualityComparer类型参数写法

    最近在使用Union.Except时,由于默认的对比不太好使,所以需要自定义对比器,下面附上代码. class MaterialListComparer : IEqualityComparer< ...

  2. linux中Shell标准输出错误 >/dev/null 2>&1 分析【转】

    Shell中可能经常能看到:>/dev/null  2>&1 eg:sudo kill -9 `ps -elf |grep -v grep|grep $1|awk '{print ...

  3. elasticsearch常见异常及解决办法

    报错信息:Java HotSpot(TM) 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000085330000, 20602552 ...

  4. mysql 日期操作 增减天数、时间转换、时间戳(转换)

    http://hi.baidu.com/juntao_li/item/094d78c6ce1aa060f6c95d0b MySQL datediff(date1,date2):两个日期相减 date1 ...

  5. 使用VS2013、TFS2013和Git进行分布式团队协作

    题记:呵呵,首先声明,题目起的有点大,其实我只想介绍下VS2013和TFS2013新加入的Git功能,也不是在VS中使用Git的详细向导(以后有空再详细分享给大家).这篇文章虽然在写这篇文章<V ...

  6. 【BZOJ】4025: 二分图

    题解 lct维护一个结束时间作为边权的最大生成树,每次出现奇环就找其中权值最小的那条边,删掉的同时还要把它标记上,直到这条边消失 如果有标记则输出No 边权通过建立虚点来维护 代码 #include ...

  7. H5的简介

    1.H5的诞生 2.介绍 HTML5 将成为 HTML.XHTML 以及 HTML DOM 的新标准. HTML5 是 W3C 与 WHATWG 合作的结果. WHATWG 致力于 web 表单和应用 ...

  8. 搭建微信小程序基本的https与wss环境

    年底了写一篇小程序环境搭建的文章, 主要是怎么搭建一个线上环境以及怎么不改动原有http Api的情况 1.准备工作 域名一个 免费证书(推荐: 腾讯云.阿里云.便宜ssl 都是免费的 配置好后先将证 ...

  9. ctrl+c ctrl+d ctrl+z 的区别和使用场景

    三者的区别 Ctrl+C :强制中断程序,程序无论运行哪里都停止. Ctrl+D :发送一个 exit 的信号,退出当前的用户或者是客户端. Ctrl+Z :暂停程序,在进程中维持挂起状态. 引用别人 ...

  10. P1244 青蛙过河

    P1244 青蛙过河NOI2000主要思想:数学归纳法 递推 压位高精度 化归 理解能力和找规律的能力题意再述:1.青蛙从上到下必须连续递增或者下面是石墩 而不能是1 12 33 4而且每时每刻都要满 ...