0

I has published an android wear app. I installed the app on Google Play and tried to sync with my Androwid Wear via Google Android Wear app but it didn't work.

I guess that the apk I installed doesn't include "WEAR.apk". How can I include it?

When I generated apk on Android Studio, two apks were generated. I uploaded just one apk "APPLICATION.apk". I expected that "APPLICATION.apk" included "WEAR.apk".

build.gradle has the dependency of WEAR.

wearApp project(':wear')

Does anybody knows any possible reasons and solutions.

Any help will be appreciated.

Thanks,

[UPDATE1]

・APPLICATION Module

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.hogehoge.bip" >

    <uses-feature android:name="android.hardware.camera" android:required="false" />
    <uses-feature android:name="android.hardware.camera.autofocus" />

    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.INTERNET" />.

    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >

        <meta-data
                android:name="com.google.android.gms.version"
                android:value="@integer/google_play_services_version" />

        <activity
                android:name="com.hogehoge.bip.MainActivity"
                android:label="@string/app_name"
                android:screenOrientation="landscape"
                android:launchMode="singleTask" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

build.gradle

apply plugin: 'android'

android {
    compileSdkVersion 18
    buildToolsVersion '20'

    defaultConfig {
        minSdkVersion 19
        targetSdkVersion 19
        versionCode 2
        versionName "0.1"
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services:5.0.+@aar'
    compile 'com.android.support:support-v4:20.0.+'
    wearApp project(':Wearable')
    compile files('libs/core-2.2.jar')
    compile files('libs/javase-2.2.jar')
    compile files('libs/android-async-http-1.4.5.jar')
}

・Wearable Module

AndroidManifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.hogehoge.bip" >

    <uses-feature android:name="android.hardware.type.watch" />

    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.VIBRATE" />

    <application
            android:allowBackup="true"
            android:icon="@drawable/ic_launcher"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.DeviceDefault">

        <meta-data
                android:name="com.google.android.gms.version"
                android:value="@integer/google_play_services_version" />

        <service
                android:name="com.hogehoge.bip.DataLayerListenerService" >
            <intent-filter>
                <action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
            </intent-filter>
        </service>

        <activity
            android:name="com.hogehoge.bip.PagerActivity"
            android:screenOrientation="portrait"
            android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
        </activity>
    </application>
</manifest>

build.gradle

apply plugin: 'android'

android {
    compileSdkVersion 20
    buildToolsVersion '20'

    defaultConfig {
        minSdkVersion 20
        targetSdkVersion 20
        versionCode 2
        versionName "0.1"
    }

    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile 'com.google.android.gms:play-services-wearable:+'
    compile files('libs/internal_impl-20.0.0.jar')
    compile files('libs/classes.jar')
}

[UPDATE2]

My app is free. Not paid app.

I generated the followings apks; Application-release.apk(3M) and Wearable-release.apk(1.1M).

[UPDATE3]

I noticed that the similar question had been posted.

Android Wear generate two apk

According to the post, I may have to use "release key". I'm checking it.

[UPDATE4]

I uncompressed the apk I publised Google Play. As a result, I found wearable.apk inside handledapp.apk.

I have no idea what should I do next. Can you help me!

[UPDATE5 SOLVED]

I followed the @Gabriele Mariotti's mention. Then it works!

Check your permissions. The Smartphone part needs to have all the permissions the Wear component has.

Use the same package id for both apps (wear and mobile)

Android Wear App not installed

Community
  • 1
  • 1
zono
  • 8,366
  • 21
  • 75
  • 113

1 Answers1

2

If this is a paid app you can't use

wearApp project(':wear')

you have to do it manually

If it's not a paid app (if it's free), does the file size of the "APPLICATION.apk" correspond to what you would expect? (i.e. wear.apk + mobile.apk)

Also post your manifest and build.gradle files.

SoftwareDev
  • 674
  • 1
  • 6
  • 14
  • Thanks for your comment. My app is free and I attached manifest and build.gradle. I would be grateful you can see it! – zono Aug 18 '14 at 11:33