I am working on the Google glass application development. I have installed the sample Compass application.
I am installing my apk file on Google Glass Emulator through adb.
But it give me the following error at the time of run:
java.lang.NoClassDefFoundError: com.google.android.glass.timeline.LiveCard
I have install the latest Glass Development Kit.
I have just modify my Manifest file as I do not want to run the apk by the voice initiation.
My Manifest File is as follows:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.google.android.glass.sample.compass"
android:versionCode="5"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="19"
android:targetSdkVersion="19" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@drawable/ic_compass" >
<activity
android:name="com.google.android.glass.sample.compass.CompassMenuActivity"
android:theme="@style/MenuTheme" />
<service
android:name=".CompassService"
android:label="@string/app_name"
android:icon="@drawable/ic_compass">
<intent-filter>
<action android:name="com.google.android.glass.sample.compass.CompassService" />
</intent-filter>
</service>
</application>
</manifest>
But it throw error at the time of Live Card creation into the Service File.
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (mLiveCard == null) {
***mLiveCard = new LiveCard(CompassService.this, LIVE_CARD_TAG);***
mRenderer = new CompassRenderer(CompassService.this, mOrientationManager, mLandmarks);
mLiveCard.setDirectRenderingEnabled(true).getSurfaceHolder().addCallback(mRenderer);
// Display the options menu when the live card is tapped.
Intent menuIntent = new Intent(this, CompassMenuActivity.class);
menuIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
mLiveCard.setAction(PendingIntent.getActivity(this, 0, menuIntent, 0));
mLiveCard.attach(this);
mLiveCard.publish(PublishMode.REVEAL);
} else {
Log.i("onStartCommand Else","onStartCommand Else");
mLiveCard.navigate();
}
return START_STICKY;
}
I am just stuck with it. Please help me. Thanks in advance...:)