无法在Android Studio中设置Hello,World watch应用
作者:互联网
在Android Studio中部署随附的Hello,World watch应用的磨损版本时,出现以下错误:
失败[INSTALL_FAILED_OLDER_SDK]
更新:从Reddit帖子中删除有关尝试L的被破解版本的详细信息,因为这对我来说不是解决方案,可能会造成更多混乱.
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:+'
}
磨损/建造
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:+'
}
New Project directions保持了所有其他功能.我在Moto Ultra 4.4和LG G手表上运行.
解决方法:
错误[INSTALL_FAILED_OLDER_SDK]是因为我正在将磨损gradle构建部署到手机(具有不兼容的api).为了将可穿戴式gradle版本部署到LG G手表,您必须设置为enable bluetooth debugging and connect your adb to the watch.,然后在“选择设备”对话框中选择手表.
标签:android-studio,wear-os,android 来源: https://codeday.me/bug/20191029/1959570.html