简体   繁体   English

Amazon SNS 示例应用程序

[英]Amazon SNS Sample Application

I'm new to the Amazon SNS Service, I just subscribed today to begin experimenting with it.我是 Amazon SNS 服务的新手,我今天刚刚订阅并开始试用它。 I logged into the Mobile Hub Console, and I created a new project.我登录到 Mobile Hub 控制台,并创建了一个新项目。 I then selected the Push Notifications, for Android, and chose to Build.然后我为 Android 选择了推送通知,并选择了构建。

In the instructions it says it should be as simple as importing the source project provided in the Build step into Android Studio, and then click Debug app.在说明中它说它应该像将构建步骤中提供的源项目导入 Android Studio 一样简单,然后单击调试应用程序。

When I do this, I immediately get a NullPointerException: null error in the event log of Android Studio.当我这样做时,我立即在 Android Studio 的事件日志中收到 NullPointerException: null 错误。 I am trying to load the MySampleApp onto an emulator to test how the push notifications work, but I can't even get the app to run due to this error.我正在尝试将 MySampleApp 加载到模拟器上以测试推送通知的工作方式,但由于此错误,我什至无法运行该应用程序。

When I click on the error in the Event Log, a pop-up shows the following details.当我单击事件日志中的错误时,会弹出一个显示以下详细信息的窗口。 I'm not sure what to do, as the instructions don't indicate anything other than Import the project into Android Studio and click Debug app.我不知道该怎么做,因为除了将项目导入 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)

Here's a couple quick things to check...这里有几个要检查的快速事项...

  1. Are you running the latest version of Android Studio (eg, 1.5.1)?您运行的是最新版本的 Android Studio(例如 1.5.1)吗?
  2. Did you choose to "Import project (Eclipse ADT, Gradle, etc)" in Android Studio?您是否选择在 Android Studio 中“导入项目(Eclipse ADT、Gradle 等)”? The sample app is a gradle project, so it must be imported.示例应用程序是一个 gradle 项目,因此必须导入它。
  3. Have you been able to launch apps on your AVD before?您以前是否能够在您的 AVD 上启动应用程序? For example, if you create a new Android app project, can you launch it successfully on your AVD from Android Studio?例如,如果您创建了一个新的 Android 应用程序项目,您能否在您的 AVD 上从 Android Studio 成功启动它?
  4. Do you see any gradle build errors in the gradle console window on the bottom of Android Studio?您是否在 Android Studio 底部的 gradle 控制台窗口中看到任何 gradle 构建错误?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM