简体   繁体   English

AWS Identity Token自动售货机-Android代码错误

[英]AWS Identity Token Vending Machine - Android Code Error

I am using; 我在用;

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

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; 按照说明,我在项目类路径中添加了以下库;

  • aws-android-sdk-1.7.0-debug.jar aws-android-sdk-1.7.0-debug.jar
  • aws-android-sdk-1.7.0.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 将不胜感激任何指针

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 不要同时添加

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

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.

相关问题 在Android中处理AWS User Pool + Fedration Identity令牌刷新系统 - Handling AWS User Pool + Fedration Identity token refresh system in android adb shell om 清除 com.android.vending 错误 - adb shell om clear com.android.vending Error Android Studio错误:包com.android.vending.billing.util不存在 - Android Studio error: package com.android.vending.billing.util does not exist 代号一 Android 构建错误 - permission#com.android.vending.BILLING - Codename One Android Build Error - permission#com.android.vending.BILLING cordova-plugin-inapppurchase错误:包com.android.vending.billing不存在 - cordova-plugin-inapppurchase error: package com.android.vending.billing does not exist 导入com.android.vending.billing.IInAppBillingService中的错误; 辅助工具 - error in import com.android.vending.billing.IInAppBillingService; aidl.exe 接收广播时出错 Intent act=com.android.vending.billing.PURCHASES_UPDATED - Error receiving broadcast Intent act=com.android.vending.billing.PURCHASES_UPDATED 来自Android的AWS Identity TVM注册 - AWS Identity TVM registration from android ANR com.android.vending.billing.IInAppBillingService - ANR com.android.vending.billing.IInAppBillingService AWS Cognito数据集和Google Identity Toolkit错误 - AWS Cognito dataset and Google Identity Toolkit error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM