2016-02-24 144 views
0

我是新來的亞馬遜SNS服務,我今天剛剛訂閱開始嘗試使用它。我登錄到移動Hub控制檯,並創建了一個新項目。然後,我選擇了Android的推送通知,並選擇了Build。亞馬遜SNS示例應用程序

在說明中它應該與將生成步驟中提供的源項目導入Android Studio一樣簡單,然後單擊調試應用程序。

當我這樣做時,我立即在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

很抱歉,您有關於AWS Mobile Hub示例應用程序和Android Studio的問題。
這裏有幾個快速的事情來檢查...

  1. 您是否運行最新版本的Android Studio(例如,1.5.1)?
  2. 您是否選擇在Android Studio中導入項目(Eclipse ADT,Gradle等)?示例應用程序是一個gradle項目,所以它必須導入。
  3. 您之前是否能夠在您的AVD上啓動應用程序?例如,如果您創建新的Android應用項目,您是否可以在Android Studio的AVD上成功啓動它?
  4. 您是否在Android Studio底部的gradle控制檯窗口中看到任何gradle build錯誤?

希望這些會指出你在正確的方向。如果沒有,請在檢查這些步驟後發佈您獲得的結果。

感謝,
Andrew C製作
移動開發者體驗
Amazon Web Services的

+0

我今天早上我的Android工作室促使我升級注意到。升級到最新版本1.5.1後,我現在可以構建和調試示例應用程序。謝謝您的幫助! – Phil