[英]AWS Identity Token Vending Machine - Android Code Error
I am using; 我在用;
For using AWS Token Vending machine code I used sample code for android from below link; 为了使用AWS Token自动售货机代码,我使用了以下链接中的android示例代码; http://aws.amazon.com/code/4598681430241367 http://aws.amazon.com/code/4598681430241367
As per instructions I added following libs to project classpath; 按照说明,我在项目类路径中添加了以下库;
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 将不胜感激任何指针
You may need to update the Eclipse project settings to ensure all classes are exported for Dexing. 您可能需要更新Eclipse项目设置,以确保所有类都已导出以进行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 使用ADT v22在Eclipse中运行适用于Android的AWS开发工具包示例
Dont add both 不要同时添加
into your classpath. 进入你的classpath。 During run time, it creates conflict regarding class files because both the jars have class files with common name. 在运行时,由于两个jar都具有通用名称的类文件,因此它会与类文件产生冲突。
Either use aws-android-sdk-1.7.0-debug.jar which creates the largest APK, but allows for full stack traces during development. 可以使用aws-android-sdk-1.7.0-debug.jar创建最大的APK,但可以在开发过程中进行完整的堆栈跟踪。 or 要么
Add aws-android-sdk-VERSION.jar which creates a smaller APK and a simple bundle when releasing your application. 添加aws-android-sdk-VERSION.jar,在发布应用程序时,它会创建一个较小的APK和一个简单的捆绑包。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.