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.
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)