Opus1217
Opus1217

Reputation: 743

Android Wear app not installing from the mobile package

Yes, I have followed all the other instructions and links. My wearable app is definitely being packaged with the mobile one, but is not installing.

The debug version of the mobile.apk is 4.9MB and of wear.apk is 1.9MB. When I build signed release versions, the mobile.apk is 5.8MB so I believe the packaging is happening.

When I do an adb install of the mobile.apk on the handheld, I get the following errors in the logcat of the handheld (the app package is com.pipperpublishing.refwatch so note the strange refwatch-1 reference in the second error):

01-27 07:49:59.129 8729-8729/? W/System.err: android.content.pm.PackageManager$NameNotFoundException: com.pipperpublishing.refwatch
01-27 07:49:59.129 8729-8729/? W/System.err:     at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:303)
01-27 07:49:59.129 8729-8729/? W/System.err:     at com.samsung.aasaservice.AASAUpdateReceiver.onReceive(AASAUpdateReceiver.java:33)
01-27 07:49:59.129 8729-8729/? W/System.err:     at android.app.ActivityThread.handleReceiver(ActivityThread.java:2948)
01-27 07:49:59.129 8729-8729/? W/System.err:     at android.app.ActivityThread.access$1800(ActivityThread.java:172)
01-27 07:49:59.129 8729-8729/? W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1498)
01-27 07:49:59.129 8729-8729/? W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
01-27 07:49:59.129 8729-8729/? W/System.err:     at android.os.Looper.loop(Looper.java:145)
01-27 07:49:59.129 8729-8729/? W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:5835)
01-27 07:49:59.129 8729-8729/? W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
01-27 07:49:59.129 8729-8729/? W/System.err:     at java.lang.reflect.Method.invoke(Method.java:372)
01-27 07:49:59.129 8729-8729/? W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
01-27 07:49:59.129 8729-8729/? W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)


01-27 07:50:54.219 771-11243/? W/System.err: java.io.FileNotFoundException: /data/app/com.pipperpublishing.refwatch-1: open failed: EISDIR (Is a directory)
01-27 07:50:54.239 771-11243/? W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:456)
01-27 07:50:54.239 771-11243/? W/System.err:     at java.io.FileInputStream.<init>(FileInputStream.java:76)
01-27 07:50:54.239 771-11243/? W/System.err:     at android.content.pm.PackageParser.getHashValueOfPackage(PackageParser.java:5141)
01-27 07:50:54.239 771-11243/? W/System.err:     at com.android.server.pm.PackageManagerService.saveHash(PackageManagerService.java:18383)
01-27 07:50:54.239 771-11243/? W/System.err:     at com.android.server.pm.PackageManagerService.access$5200(PackageManagerService.java:329)
01-27 07:50:54.239 771-11243/? W/System.err:     at com.android.server.pm.PackageManagerService$20.run(PackageManagerService.java:18368)
01-27 07:50:54.239 771-11243/? W/System.err: Caused by: android.system.ErrnoException: open failed: EISDIR (Is a directory)
01-27 07:50:54.239 771-11243/? W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:446)
01-27 07:50:54.239 771-11243/? W/System.err:    ... 5 more

I have tried a factory reset of the watch, resyncing, etc etc. Any ideas?

Here's my mobile build.gradle:

apply plugin: 'com.android.application'


android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

defaultConfig {
    applicationId "com.pipperpublishing.refwatch"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 203
    versionName "0.2.03"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    }
 }

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.android.support:design:23.1.1'
compile 'com.google.android.gms:play-services-ads:8.4.0'
compile 'com.google.android.gms:play-services-identity:8.4.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
 }
 apply plugin: 'com.google.gms.google-services'

and my "wear" build.gradle:

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion '23.0.2'
defaultConfig {
    applicationId "com.pipperpublishing.refwatch"
    minSdkVersion 21
    targetSdkVersion 23
    versionCode 203
    versionName "0.2.03"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debug {
        debuggable true
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.3.0'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:support-v13:23.1.1'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
compile 'com.google.android.gms:play-services-auth:8.4.0'
}
apply plugin: 'com.google.gms.google-services'    

Upvotes: 0

Views: 523

Answers (2)

Opus1217
Opus1217

Reputation: 743

So, after multiple uninstalls and reinstalls, but without changing any code, the install is now working. Sometimes I have to "Resync applications" to see changes on the phone. The whole process seems quite clunky.

Upvotes: 1

Adarsh Mathew Thomas
Adarsh Mathew Thomas

Reputation: 91

Only using the release .apk file will the wear application get automatically installed. It wont work using the debug key.

In case the application is signed with a release key, then check whether the application already exists in the android wear device.

Upvotes: 2

Related Questions