Install APK with adb:
$ platform-tools/adb install out/target/product/generic/system/app/
233 KB/s (12588 bytes in 0.052s)
pkg: /data/local/tmp/
Failure [INSTALL_FAILED_OLDER_SDK]
Error message in logcat:
D/PackageParser( 60): Scanning package: /data/app/
W/PackageParser( 60): /data/app/ (at Binary XML file line #0): Requires development platform AOSP but this is a release platform.
The error was created by , which compares the android:minSdkVersion and android:targetSdkVersion attributes of the uses-sdk element of in the APK file against the SDK version of the device or emulator. The SDK version on the device has to be greater than that required by android:minSdkVersion.
In my case, since I built the package with AOSP, the target emulator has to be AOSP also. This is the relavant section in :
<uses-sdk android:minSdkVersion="AOSP"
android:targetSdkVersion="AOSP">
</uses-sdk>
And the relevant section in :
if (minCode != null) {
if (!(SDK_CODENAME)) {
if (SDK_CODENAME != null) {
outError[0] = "Requires development platform " + minCode
+ " (current platform is " + SDK_CODENAME + ")";
} else {
outError[0] = "Requires development platform " + minCode
+ " but this is a release platform.";
}
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
return null;
}
} else if (minVers > SDK_VERSION) {
outError[0] = "Requires newer sdk version #" + minVers
+ " (current version is #" + SDK_VERSION + ")";
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
return null;
}
if (targetCode != null) {
if (!(SDK_CODENAME)) {
if (SDK_CODENAME != null) {
outError[0] = "Requires development platform " + targetCode
+ " (current platform is " + SDK_CODENAME + ")";
} else {
outError[0] = "Requires development platform " + targetCode
+ " but this is a release platform.";
}
mParseError = PackageManager.INSTALL_FAILED_OLDER_SDK;
return null;
}
// If the code matches, it definitely targets this SDK.
= .VERSION_CODES.CUR_DEVELOPMENT;
} else {
= targetVers;
}
相关文章
- python中使用提示的python -m pip install --upgrade pip升级失败解决方案
- 删除软件的安装文件时提示“操作无法完成,因为文件已在system中打开”,怎么办?
- pip安装软件时出现Command "python egg_info" failed with error code 1 in /tmp/pip-build*的解决方案
- 解决Centos7安装NPM之后bash: node: 未找到命令的错误
- 安装IntelliJ IDEA后的报project sdk is not defined错误
- 错误:PermissionError: [WinError 32] 另一个程序正在使用此文件,进程无法访问。“+文件路径“的解决方案
- “错误 1067:进程意外终止”的原因和解决方案
- 关于注册苹果开发者账号时登录遇到的提示未知错误_s芃成_新浪博客
- pythondistutils安装_python3 安装pip提示没有模块错误的解决
- Window 2003 Server R2安装IIS时总提示“需要Service Pack 2 CD-Rom 上的文件”