With the following Gradle files of my three modules (common, mobile, and wear), I was wondering why my wearable app doesn't install on the wearable device when I run the mobile app with both the wear virtual emulator and my mobile device running and connected (through USB and the Android wear app), and signed both apks through the mobile module (currently in the mobile directory):
Common module:
apply plugin: 'com.android.library'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
Mobile module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "dpark.gameoflife"
minSdkVersion 9
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file("C:\Users\Dave\AndroidStudioProjects\KEY_STORE\Game_of_Life.jks")
storePassword "***"
keyAlias "game_of_life"
keyPassword "***"
}
release {
storeFile file("C:\Users\Dave\AndroidStudioProjects\KEY_STORE\Game_of_Life.jks")
storePassword "***"
keyAlias "game_of_life"
keyPassword "***"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile project(':common')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
}
Wear module:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "dpark.gameoflife"
minSdkVersion 22
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
signingConfigs {
debug {
storeFile file("C:\Users\Dave\AndroidStudioProjects\KEY_STORE\Game_of_Life.jks")
storePassword "***"
keyAlias "game_of_life"
keyPassword "***"
}
release {
storeFile file("C:\Users\Dave\AndroidStudioProjects\KEY_STORE\Game_of_Life.jks")
storePassword "***"
keyAlias "game_of_life"
keyPassword "***"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.3.0'
compile 'com.google.android.gms:play-services-wearable:8.4.0'
compile project(':common')
}
Common manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest
package="dpark.common" >
</manifest>
Mobile manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dpark.gameoflife" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme.NoActionBar" >
<activity
android:name=".MainActivity">
</activity>
<activity
android:name=".WelcomeActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
Wear manifest:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dpark.gameoflife" >
<uses-feature android:name="android.hardware.type.watch" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true" >
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</activity>
<activity
android:name=".WelcomeActivity"
android:theme="@android:style/Theme.DeviceDefault" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
... While the app properly installs on my mobile device, I only get a notification (at most when my sample app is simply supposed to display a GridView) on my wear virtual emulator as follows:
Thanks!
EDIT AS OF 4/4:
-Here's what I get on my logcat:
04-04 09:39:27.462 15810-15810/dpark.gameoflife I/art: Late-enabling -Xcheck:jni
04-04 09:39:27.462 15810-15810/dpark.gameoflife I/art: VMHOOK: rlim_cur : 0 pid:15810
04-04 09:39:27.543 15810-15810/dpark.gameoflife W/System: ClassLoader referenced unknown path: /data/app/dpark.gameoflife-1/lib/arm
04-04 09:39:27.570 15810-15810/dpark.gameoflife I/GMPM: App measurement is starting up, version: 8487
04-04 09:39:27.571 15810-15810/dpark.gameoflife I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE
04-04 09:39:27.580 15810-15810/dpark.gameoflife E/GMPM: GoogleService failed to initialize, status: 10, Missing an expected resource: 'R.string.google_app_id' for initializing Google services. Possible causes are missing google-services.json or com.google.gms.google-services gradle plugin.
04-04 09:39:27.580 15810-15810/dpark.gameoflife E/GMPM: Scheduler not set. Not logging error/warn.
04-04 09:39:27.644 15810-15831/dpark.gameoflife E/GMPM: Uploading is not possible. App measurement disabled
04-04 09:39:27.763 15810-15847/dpark.gameoflife I/Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8974_LA.BF.1.1.3__release_AU (I3fa967cfef)
04-04 09:39:27.763 15810-15847/dpark.gameoflife I/Adreno-EGL: OpenGL ES Shader Compiler Version: E031.28.00.02
04-04 09:39:27.763 15810-15847/dpark.gameoflife I/Adreno-EGL: Build Date: 09/29/15 Tue
04-04 09:39:27.763 15810-15847/dpark.gameoflife I/Adreno-EGL: Local Branch: mybranch14683032
04-04 09:39:27.763 15810-15847/dpark.gameoflife I/Adreno-EGL: Remote Branch: quic/master
04-04 09:39:27.763 15810-15847/dpark.gameoflife I/Adreno-EGL: Local Patches: NONE
04-04 09:39:27.763 15810-15847/dpark.gameoflife I/Adreno-EGL: Reconstruct Branch: NOTHING
04-04 09:39:37.863 15810-15831/dpark.gameoflife I/GMPM: Tag Manager is not found and thus will not be used
04-04 09:43:06.197 15810-15847/dpark.gameoflife E/Surface: getSlotFromBufferLocked: unknown buffer: 0xb9d385f0
... Am I missing something either in my Manifest or Gradle files as shown above in this post?
See Question&Answers more detail:
os