我发布了一个android服装应用程序 . 我在Google Play上安装了该应用,并尝试通过Google Android Wear应用与我的Androwid Wear进行同步,但它无效 .
我猜我安装的apk不包含“WEAR.apk” . 我怎么能包括它?
当我在Android Studio上生成apk时,生成了两个apks . 我上传了一个apk“APPLICATION.apk” . 我预计“APPLICATION.apk”包括“WEAR.apk” .
build.gradle具有WEAR的依赖性 .
wearApp project(':wear')
有谁知道任何可能的原因和解决方案 .
任何帮助将不胜感激 .
谢谢,
[UPDATE1]
·应用模块
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')
}
·可穿戴模块
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]
我的应用是免费的 . 没有付费应用 .
我生成了以下apks; Application-release.apk(3M)和Wearable-release.apk(1.1M) .
[UPDATE3]
我注意到类似的问题已经发布了 .
根据帖子,我可能不得不使用“释放密钥” . 我正在检查它 .
[UPDATE4]
我解压缩了我发布Google Play的apk . 结果,我在processedapp.apk中找到了wearable.apk .
我不知道接下来该怎么办 . 你能帮助我吗!
[UPDATE5已解决]
我跟着@Gabriele Mariotti提到了 . 然后它的作品!
检查您的权限 . Smartphone部分需要具有Wear组件具有的所有权限 . 对两个应用程序使用相同的包ID(穿戴和移动)
1 回答
如果这是付费应用,则无法使用
你必须do it manually
如果它不是付费应用程序(如果它是免费的),“APPLICATION.apk”的文件大小是否符合您的预期? (即wear.apk mobile.apk)
同时发布您的清单和build.gradle文件 .