我最近下载了Android API 21,以便在Android Studio BETA中使用。
我为我的应用设置了最低要求的SDK版本为21.这样做之后,我无法在我的设备上运行我的应用程序(MOTO G Android 4.4 KITKAT) 以下消息
Waiting for device.
Target device: motorola-xt1033-TA93305SP4
Uploading file
local path: C:\Users\GeeBee\AndroidStudioProjects\testApp8\app\build\outputs\apk\app-debug.apk
remote path: /data/local/tmp/com.example.geebee.testapp8
Installing com.example.geebee.testapp8
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.example.geebee.testapp8"
WARNING: linker: app_process has text relocations. This is wasting memory and is a security risk. Please fix.
WARNING: linker: app_process has text relocations. This is wasting memory and is a security risk. Please fix.
pkg: /data/local/tmp/com.example.geebee.testapp8
Failure [INSTALL_FAILED_OLDER_SDK]
以下是我的build.gradle文件的内容
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.0.0"
defaultConfig {
applicationId "com.example.geebee.testapp8"
minSdkVersion 21
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}
只要我将API版本更改为较低级别,它就可以正常部署。 API 21会出现什么问题?请帮帮我吧......
答案 0 :(得分:0)
您正在将minSdkVersion设置为21.您实际上是在告诉Android您的应用无法在版本21之前的任何SDK上运行。您应该将minSdkVersion设置为更低的值,例如19(4.4 Kitkat)。