0

I am using;

  • Eclipse Juno
  • ADT-22.3.0
  • aws-android-sdk-1.7.0

For using AWS Token Vending machine code I used sample code for android from below link; http://aws.amazon.com/code/4598681430241367

As per instructions I added following libs to project classpath;

  • aws-android-sdk-1.7.0-debug.jar
  • aws-android-sdk-1.7.0.jar

and when I run in emulator and device; I receive following error at runtime (no error at compile time)

 java.lang.NoClassDefFoundError: com.amazonaws.util.DateUtils
    at com.amazonaws.tvmclient.Utilities.getTimestamp(Utilities.java:28)
    at com.amazonaws.tvmclient.LoginRequest.buildRequestUrl(LoginRequest.java:50)
....

However, in code when I checked - the class is imported and there are no compile time errors

import com.amazonaws.util.DateUtils;

and here how it is used in code (Utilities class sample code);

new DateUtils().formatIso8601Date( new Date() );

would appreciate any pointers

khawarizmi
  • 593
  • 5
  • 19

2 Answers2

0

You may need to update the Eclipse project settings to ensure all classes are exported for Dexing. Please take a look at the instructions at the following blog post and see if this solves your issue:

Running AWS SDK for Android samples in Eclipse with ADT v22

Bob Kinney
  • 8,870
  • 1
  • 27
  • 35
0

Dont add both

  1. aws-android-sdk-1.7.0-debug.jar
  2. aws-android-sdk-1.7.0.jar

into your classpath. During run time, it creates conflict regarding class files because both the jars have class files with common name.

Either use aws-android-sdk-1.7.0-debug.jar which creates the largest APK, but allows for full stack traces during development. or

Add aws-android-sdk-VERSION.jar which creates a smaller APK and a simple bundle when releasing your application.

Prabhu M
  • 3,534
  • 8
  • 48
  • 87