2
Vote

NoClassDefFoundError with HealthVaultSettingsFile

description

Hi - i recently downloaded the healthvault for android api and went through the instructions to install it and include it into Eclipse. I tried to run the android-weight-app and I get an "NoClassDefFoundError" for HealthVaultSettingsFile. I tried including the android-sdk project source and even exported the android-sdk project to a Jar and included it as a library into the build path for android-weight-app and nothing resolves the issue. What am I doing wrong?

Here is the logcat output:

07-16 19:28:02.823: W/dalvikvm(454): VFY: unable to find class referenced in signature (Lcom/microsoft/hsg/android/HealthVaultService;)
07-16 19:28:02.823: E/dalvikvm(454): Could not find class 'com.microsoft.hsg.android.HealthVaultFileSettings', referenced from method com.microsoft.hsg.android.demo.weight.Welcome.onCreate
07-16 19:28:02.831: W/dalvikvm(454): VFY: unable to resolve new-instance 28 (Lcom/microsoft/hsg/android/HealthVaultFileSettings;) in Lcom/microsoft/hsg/android/demo/weight/Welcome;
07-16 19:28:02.842: D/dalvikvm(454): VFY: replacing opcode 0x22 at 0x0009
07-16 19:28:02.842: D/dalvikvm(454): VFY: dead code 0x000b-0037 in Lcom/microsoft/hsg/android/demo/weight/Welcome;.onCreate (Landroid/os/Bundle;)V
07-16 19:28:03.114: D/AndroidRuntime(454): Shutting down VM
07-16 19:28:03.114: W/dalvikvm(454): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
07-16 19:28:03.132: E/AndroidRuntime(454): FATAL EXCEPTION: main
07-16 19:28:03.132: E/AndroidRuntime(454): java.lang.NoClassDefFoundError: com.microsoft.hsg.android.HealthVaultFileSettings
07-16 19:28:03.132: E/AndroidRuntime(454): at com.microsoft.hsg.android.demo.weight.Welcome.onCreate(Welcome.java:44)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.os.Handler.dispatchMessage(Handler.java:99)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.os.Looper.loop(Looper.java:123)
07-16 19:28:03.132: E/AndroidRuntime(454): at android.app.ActivityThread.main(ActivityThread.java:4627)
07-16 19:28:03.132: E/AndroidRuntime(454): at java.lang.reflect.Method.invokeNative(Native Method)
07-16 19:28:03.132: E/AndroidRuntime(454): at java.lang.reflect.Method.invoke(Method.java:521)
07-16 19:28:03.132: E/AndroidRuntime(454): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
07-16 19:28:03.132: E/AndroidRuntime(454): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
07-16 19:28:03.132: E/AndroidRuntime(454): at dalvik.system.NativeStart.main(Native Method)

comments

ssankara73 wrote Jul 17, 2013 at 4:39 PM

It appears that this issue is related to how Eclipse (newer versions) handle the libraries... I had to include a new folder in the project called "libs", export the android-sdk project that contains all the included classes in com.microsoft.hsg.android to a simple jar and place the jar in the libs folder and include it into the build path. That seemed to have solved the problem. Also please see:
http://stackoverflow.com/questions/11886240/vfy-unable-to-find-class-referenced-in-signature

santosh390 wrote Jul 30, 2013 at 9:50 AM

Download R1.4.0 from https://healthvaultjavalib.codeplex.com/releases/view/109626
Unzip to a local directory
Are you using Eclipse? If so, import the project via File -> Import -> Android -> Existing Android Code into Workspace
First you have import android-sdk project

Then you have to import android-weight-app

in android-weight-app you have to use "android -sdk" project as an library project

wrote Jul 30, 2013 at 1:00 PM