问题描述
在 Android Studio 中部署包含的 Hello, World 手表应用程序的磨损版本时,我收到此错误:失败 [INSTALL_FAILED_OLDER_SDK]
When deploying the wear version of the included Hello, World watch app in Android Studio I get this error:Failure [INSTALL_FAILED_OLDER_SDK]
更新:从 Reddit 帖子中删除了有关尝试破解 L 版本的详细信息,因为这对我来说不是解决方案,而且可能会造成更多混乱.
Update: Removing details about trying a hacked version of L from the Reddit post as that was not a solution for me and it may have created more confusion.
移动/build.gradle
mobile/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.erikbabel.myapplication"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.android.support:appcompat-v7:19.+'
compile 'com.google.android.gms:play-services-wearable:+'
}
wear/build.gradle
wear/build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.erikbabel.myapplication"
minSdkVersion 20
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}
新项目方向未触及其他所有内容.我使用 Moto Ultra 4.4 和 LG G 手表跑步.
Everything else is untouched from the New Project directions. I'm running on my Moto Ultra 4.4 and the LG G watch.
推荐答案
错误 [INSTALL_FAILED_OLDER_SDK] 是因为我正在将 Wear gradle build 部署到手机(具有不兼容的 api).要将可穿戴 gradle 版本部署到 LG G 手表,您必须启用蓝牙调试并将您的 adb 连接到手表. 然后在选择设备"对话框中选择手表.
The error [INSTALL_FAILED_OLDER_SDK] is because I was deploying the wear gradle build to the phone (which has an incompatible api). In order to deploy the wearable gradle build to the LG G watch, you have to enable bluetooth debugging and connect your adb to the watch. Then select the watch in the Choose Device dialog.
这篇关于在 Android Studio 中设置 Hello, World 手表应用程序时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!