3

When deploying the wear version of the included Hello, World watch app in Android Studio I get this error: Failure [INSTALL_FAILED_OLDER_SDK]

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.

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

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:+'
}

Everything else is untouched from the New Project directions. I'm running on my Moto Ultra 4.4 and the LG G watch.

Erik B
  • 2,810
  • 1
  • 34
  • 38
  • have you checked your target sdk min sdk in the manifest? – reidisaki Jul 02 '14 at 20:52
  • 1
    possible duplicate of [Failure \[INSTALL\_FAILED\_OLDER\_SDK\] Android-L](http://stackoverflow.com/questions/24457831/failure-install-failed-older-sdk-android-l) – hichris123 Jul 02 '14 at 20:52
  • @hichris123 Yes, thank you! I'm surprised that didn't come up in my searches! – Erik B Jul 02 '14 at 21:01
  • Actually it solves one problem, but another is lingering behind it. I will update my question. – Erik B Jul 02 '14 at 21:58
  • Also, this differs from the link as this is a wearable project. The linked question doesn't mention anything wear specific. – Erik B Jul 03 '14 at 22:38
  • @ErikB Could you please explain exactly what you did from that reddit post that fixed your issue? – alice.harrison Jul 09 '14 at 20:23
  • 1
    @justin.harrison I did all the steps, which includes downloading a hacked version of L, and pointing the config to it. Could be that it is directly causing the current problem, which would mean it isn't a solution at all. I've resigned to wait till I get a L phone and see if that will work better, or hopefully google will fix this issue. – Erik B Jul 10 '14 at 01:20
  • After setting up an Emulator, I notice that I can deploy the 'wear' app to the wearable with success and deploying the 'wear' app to phone produces the same [INSTALL_FAILED_OLDER_SDK] error. With a real watch/phone combo, there must be some other way to deploy than what the tutorial describes. – Erik B Jul 17 '14 at 20:16

2 Answers2

4

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.

Erik B
  • 2,810
  • 1
  • 34
  • 38
0

OP has solved this issue, noting that a wearable app can be deployed directly to the wearable device for debugging, but not to a phone. The other option is to package the wearable app inside of a handheld app and deploy the handheld app to the phone. This will then cause the wearable app to be deployed to the wearable device paired with the phone. As of writing this, this is the only method to include a wearable app in the Play Store.

When publishing to users, you must package a wearable app inside of a handheld app, because users cannot browse and install apps directly on the wearable. If packaged properly, when users download the handheld app, the system automatically pushes the wearable app to the paired wearable.

Note: This feature doesn't work when you are signing your apps with a debug key when developing. While developing, installing apps with adb install or Android Studio directly to the wearable is required.

Source: https://developer.android.com/training/wearables/apps/packaging.html

Community
  • 1
  • 1
computermacgyver
  • 802
  • 7
  • 15