亚马逊SNS示例应用程序

时间:2016-02-24 21:46:34

标签: android amazon-web-services aws-mobilehub

我是亚马逊SNS服务的新手,我今天刚刚订阅,开始尝试它。我登录了Mobile Hub控制台,并创建了一个新项目。然后,我为Android选择了Push Notifications,并选择了Build。

在说明中它说它应该像将Build步骤中提供的源项目导入Android Studio一样简单,然后单击Debug app。

当我这样做时,我立即在Android Studio的事件日志中收到NullPointerException:null错误。我正在尝试将MySampleApp加载到模拟器上以测试推送通知的工作方式,但由于此错误,我甚至无法让应用程序运行。

当我单击事件日志中的错误时,弹出窗口会显示以下详细信息。我不知道该怎么做,因为除了将项目导入Android Studio并单击调试应用程序之外,其他任何说明都没有。

null
java.lang.NullPointerException
    at com.android.tools.idea.run.AndroidSessionInfo.isEmbeddable(AndroidSessionInfo.java:62)
    at com.android.tools.idea.run.AndroidRunConfigurationBase.getOldSessionTarget(AndroidRunConfigurationBase.java:307)
    at com.android.tools.idea.run.AndroidRunConfigurationBase.getState(AndroidRunConfigurationBase.java:279)
    at com.intellij.execution.runners.ExecutionEnvironment.getState(ExecutionEnvironment.java:201)
    at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:58)
    at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:31)
    at com.intellij.execution.runners.BaseProgramRunner.execute(BaseProgramRunner.java:53)
    at com.intellij.execution.runners.GenericProgramRunner.execute(GenericProgramRunner.java:31)
    at com.intellij.execution.ProgramRunnerUtil.executeConfiguration(ProgramRunnerUtil.java:94)
    at com.intellij.execution.impl.ExecutionManagerImpl.start(ExecutionManagerImpl.java:396)
    at com.intellij.execution.impl.ExecutionManagerImpl.access$400(ExecutionManagerImpl.java:61)
    at com.intellij.execution.impl.ExecutionManagerImpl$5.run(ExecutionManagerImpl.java:384)
    at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
    at com.intellij.util.Alarm$Request$1.run(Alarm.java:351)
    at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:332)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:706)
    at java.awt.EventQueue$3.run(EventQueue.java:704)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
    at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:734)
    at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:569)
    at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:382)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

1 个答案:

答案 0 :(得分:1)

很高兴听到您在使用AWS Mobile Hub示例应用和Android Studio时遇到问题。
这里有几件快速检查的事情......

  1. 您是否在运行最新版本的Android Studio(例如,1.5.1)?
  2. 您是否选择了#34;导入项目(Eclipse ADT,Gradle等)"在Android Studio?示例应用程序是一个gradle项目,因此必须导入它。
  3. 您之前是否能够在AVD上启动应用程序?例如,如果您创建一个新的Android应用项目,是否可以在Android Studio的AVD上成功启动它?
  4. 您是否在Android Studio底部的gradle控制台窗口中看到任何gradle构建错误?
  5. 希望这些能指出正确的方向。如果没有,请在检查这些步骤后发布您获得的任何结果
    谢谢,
    安德鲁C
    移动开发者体验
    亚马逊网络服务