adb安装apk报错“Failure [INSTALL_FAIL
2018-07-27 本文已影响0人
阡陌晗雪
今儿使用adb将本地apk安装到手机上出现一个问题:
Failed to install C:\Users\admin\Desktop\myThreeApp.apk: Failure [INSTALL_FAILED_OLDER_SDK: Failed parse during installPackageLI: /data/app/vmdl1564794666.tmp/base.apk (at Binary XML file line #0): Requires newer sdk version #27 (current version is #24)]
意思就是当前设备的Android版本过低了,apk不支持
解决方式:
指定最低minSdkVersion、targetSdkVersion
在Manifest文件中添加如下语句:
<uses-sdk android:minSdkVersion="17" android:targetSdkVersion="25"/>
或者修改build.gradle文件:
defaultConfig {
applicationId "com.example.XXX.XXXX"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
修改后,重新编译生成apk,重新尝试安装