Android Wear: Not sync my app to Watch. Why? -
i has published android wear app. installed app on google play , tried sync androwid wear via google android wear app didn't work.
i guess apk installed doesn't include "wear.apk". how can include it?
when generated apk on android studio, 2 apks generated. uploaded 1 apk "application.apk". expected "application.apk" included "wear.apk".
build.gradle has dependency of wear.
wearapp project(':wear')
does knows possible reasons , solutions.
any 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 free. not paid app.
i generated followings apks; application-release.apk(3m) , wearable-release.apk(1.1m).
[update3]
i noticed similar question had been posted.
according post, may have use "release key". i'm checking it.
[update4]
i uncompressed apk publised google play. result, found wearable.apk inside handledapp.apk.
i have no idea should next. can me!
[update5 solved]
i followed @gabriele mariotti's mention. works!
check permissions. smartphone part needs have permissions wear component has.
use same package id both apps (wear , mobile)
if paid app can't use
wearapp project(':wear')
you have do manually
if it's not paid app (if it's free), file size of "application.apk" correspond expect? (i.e. wear.apk + mobile.apk)
also post manifest , build.gradle files.
Comments
Post a Comment