2

I'm getting errors related to an issue with my app having been compiled on an earlier version. In Android Studio I was using 'compileSdkVersion "Google Inc.:Glass Development Kit Sneak Peek:15"' in my build.gradle but after trying to send an app to my device I'm getting:

    4277-4277/com.myapp.app E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.myapp.app, PID: 4277
java.lang.NoClassDefFoundError: com.google.android.glass.timeline.TimelineManager
ccoleman
  • 135
  • 2
  • 7

7 Answers7

3

compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"

kurtisnelson
  • 367
  • 1
  • 7
  • Unfortunately, my gradle is still complaining: Error:Module 'app': platform 'Google Inc.:Glass Development Kit Preview:19' not found. – ccoleman Apr 16 '14 at 05:00
  • Same here, compileSdkVersion "Google Inc.:Glass Development Kit Preview:19" not found. – Mariux Apr 16 '14 at 07:39
  • I'm seeing the error - `Could not determine the dependencies of task ':onebusaway-android:packageDebug'. > failed to find target Google Inc.:Glass Development Kit Sneak Peek:19`. I installed the GDK preview for API 19 in Android SDK. @kurtisnelson did you also add the new gdk.jar to the `libs` folder as a dependency? – Sean Barbeau Apr 16 '14 at 15:38
  • Ah, sorry, I missed the change in name from "Sneak Peak" to "Preview". This is working for me now, with `compileSdkVersion "Google Inc.:Glass Development Kit Preview:19"`, and including the new `gdk.jar` from `\add-ons\addon-google_gdk-google-19\libs` – Sean Barbeau Apr 16 '14 at 15:43
2

As the release notes say, TimelineManager has been removed. After you change your compileSdkVersion as kurtisnelson pointed out, you'll need to revise your code to create LiveCards directly

1

I was trying to get this to work in IntelliJ IDEA, and what I ended up doing is going into project structure (+;) and changing the Build target under SDKs to Glass Development Kit Preview (4.4.2):

Project structure screenshot

Note: Make sure build.gradle still has the proper compileSdkVersion value:

"Google Inc.:Glass Development Kit Preview:19"
Mark
  • 39,169
  • 11
  • 42
  • 48
1

Upgrade Android Studio to 0.5.5 and set the string to "Google Inc.:Glass Development Kit Preview:19".

There was an issue with IDE not picking up the right JDK even though gradle used the correct version. Google pushed an update earlier today.

Yevgeniy
  • 1,313
  • 2
  • 13
  • 26
0

I was also using Android Studio and had terrible luck getting a previously functional Glass app to compile on XE16. I had changed the build.gradle to exactly what kurtisnelson answered here without luck. Android Studio acts like it doesn't see the SDK update.

[edit: Android Studio just got an update to 0.5.5 which fixed this issue]

I ended up switching to the Android Development Tools (ADT) bundle running on Eclipse, and things went smoothly. http://developer.android.com/sdk/installing/bundle.html

Side note: if you're using voice commands, don't forget to add this to your manifest file:

<uses-permission android:name="com.google.android.glass.permission.DEVELOPMENT" />

If your voice command isn't on the pre-approved list of words, you have to add this Development permission to your app. See here for more details: https://developers.google.com/glass/distribute/voice-checklist

Community
  • 1
  • 1
adamup
  • 1,508
  • 19
  • 29
  • Don't forget to copy the new `gdk.jar` from `\add-ons\addon-google_gdk-google-19\libs` into your `libs` directory. And, try `gradlew installDebug` from the command line. – Sean Barbeau Apr 16 '14 at 15:56
  • Looks like Android Studio just got an update to 0.5.5 which allowed it to recognize the new SDK version ("Google Inc.:Glass Development Kit Preview:19"). – adamup Apr 17 '14 at 17:57
  • Agreed, looks like build now succeeds in Android Studio 0.5.5 without adding `gdk.jar` to `libs` folder. – Sean Barbeau Apr 17 '14 at 18:01
0

Update the Glass Development Kit Preview using the Android SDK Manager. Under Android Platform 4.4.2 you can select it.

Try running a example of this new versión and compare it with your code.

CharlyKno
  • 11
  • 1
0

To make Gradle happy, you'll need to upgrade a few things, and then modify the build.gradle file located in your app's module.

  1. Upgrade Android Studio to at 0.5.5. You can either use the built in "Check for updates" feature or download it directly.
  2. Open your Android SDK Manager and install the latest version of GDK. It will be under a new folder, 4.4.2, with the title Glass Development Kit Preview.
  3. Open your existing GDK project and edit the inner build.gradle file found in your app's module. For imported projects this would be <project root>/app/build.gradle
  4. Change your compileSdkVersion to 19. It will result in a file that looks something like this:

    apply plugin: 'android'
    
    android {
        compileSdkVersion 19
        buildToolsVersion "19.0.3"
    
        defaultConfig {
            minSdkVersion 19
            targetSdkVersion 19
        }
    ...
    }
    
mimming
  • 13,974
  • 3
  • 45
  • 74
  • That's exactly what I did last night. Great write-up and very helpful for any future build of Glass as I also had to create a separate project for a second pair that failed to update. Thank you. – ccoleman Apr 16 '14 at 22:59
  • I'll have something better to add tomorrow. The current answer unfortunately loads the stub methods in gdk.jar into the apk, which then trusts the class loader to find the actual implementations on the device. It works, but it's dangerous and brittle. In other words, if it freaks out at run time, sorry! :D – mimming Apr 17 '14 at 05:21
  • After the update to 0.5.5 the compileSdkVersion "Google Inc.:Glass Development Kit Preview:19" works! I was able to delete the jar from my lib file and compile with only this addition to the gradle. That is strange behavior, Jenny. I did not know that happened behind the scenes. Very interesting! – ccoleman Apr 17 '14 at 15:08
  • I also updated, and that does indeed fix it. I'm updating my answer to reflect that. – mimming Apr 17 '14 at 22:38