我試圖發送消息,從手持設備到wear-emulator, (根據this tutorial)。 不幸的是我的WearableListenerService.onMessageReceived沒有被調用。WearableListenerService onMessageReceived不會被解僱[android wear]
在這裏,所以我看了它可以與gradle.build文件以某種方式相關,
我在 '移動' 模塊(手持式)gradle.build:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.benji.data"
minSdkVersion 15
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:+'
}
我gradle.build在'穿'模塊:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.example.benji.data"
minSdkVersion 20
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:+'
compile 'com.google.android.gms:play-services-wearable:+'
}
我已經設置了一切,因爲它是在前面提到的教程。
感謝您的任何可能的答案
你有沒有在你的清單註冊了嗎? – 2014-08-28 11:05:40
@Gabriele是的+我發佈了一個解決方案。 – Benji 2014-08-28 11:32:33