0

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...:)

Manali Sheth
  • 379
  • 2
  • 5
  • 17

1 Answers1

0

The XE16 release on April 15, 2014 had breaking changes to the GDK, meaning old Glassware will not always work. You can read the details here:

https://developers.google.com/glass/release-notes

The relevant note to this issue is:

The TimelineManager class and support for static cards from the GDK have been removed.

So, this code base needs to be updated to work with XE16.

I can eventually make a pull request for that, but in the meantime you can see a similar Pull Request I did which repaired a project that is a fork of the Compass app:

https://github.com/mimming/kitty-compass/pull/1

By following the changes I made you should be able to see how to fix the Compass app to make it compatible with XE16.

Mark Scheel
  • 2,963
  • 1
  • 20
  • 23