我正在使用UserPreferenceDemo(示例AWS Android SDK应用程序)中的一些代码.我使示例应用程序正常工作,以便能够创建新的DynamoDB表.但是,当我尝试在我的应用程序中实现相同的代码时,我在AmazonClIEntManager类中收到日志消息“凭据已过期”,并且我的应用程序崩溃.
这是我用来创建表格的代码.
final button submit = (button) findVIEwByID(R.ID.bsubmitComplete)submit.setonClickListener(new VIEw.OnClickListener() { public voID onClick(VIEw v) { Log.i(TAG, "submitBttn clicked."); new DynamoDBManagerTask() .execute(DynamoDBManagerType.CREATE_table); }});
这是记录消息的代码.
public Response valIDateCredentials() { Response abletoGetToken = Response.SUCCESSFul; if (AmazonSharedPreferencesWrapper .areCredentialsExpired(this.sharedPreferences)) { synchronized (this) { if (AmazonSharedPreferencesWrapper .areCredentialsExpired(this.sharedPreferences)) { Log.i(LOG_TAG, "Credentials were expired."); AmazonTVMClIEnt tvm = new AmazonTVMClIEnt( this.sharedPreferences, PropertyLoader.getInstance().getTokenvendingMachineURL(), PropertyLoader.getInstance().useSSL() ); abletoGetToken = tvm.anonymousRegister(); if (abletoGetToken.requestWasSuccessful()) { abletoGetToken = tvm.getToken(); if (abletoGetToken.requestWasSuccessful()) { Log.i(LOG_TAG, "Creating New Credentials."); initClIEnts(); } } } } } else if (ddb == null) { synchronized (this) { if (ddb == null) { Log.i(LOG_TAG, "Creating New Credentials."); initClIEnts(); } } } return abletoGetToken;}
解决方法:
简单的解决方法,愚蠢的问题,但是我花了好一会儿来解决这个问题.
卸载并重新安装该应用程序.现在可以了
总结以上是内存溢出为你收集整理的在Android上使用AWS TVM凭证已过期全部内容,希望文章能够帮你解决在Android上使用AWS TVM凭证已过期所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)