2012-06-05 89 views
0

我做了這個溫度轉換器應用程序,代碼是完美的。 但每當我運行AVD它顯示了以下錯誤:Android項目中的錯誤

[2012-06-05 12:22:58 - Emulator] Failed to allocate memory: 1455 
[2012-06-05 12:22:58 - Emulator] 
[2012-06-05 12:22:58 - Emulator] This application has requested the Runtime to terminate it in an unusual way. 
[2012-06-05 12:22:58 - Emulator] Please contact the application's support team for more information. 
+0

是否在設備運行.....? – Bhavin

+0

你確定代碼是「完美」嗎?或者它工作? :P這是一個區別。除了開玩笑,我相信你可以指定給AVD的RAM。如果你運行的是android 4.0,你可能想要1024或更多。 –

+0

其他應用程序工作正常嗎? – GAMA

回答

0

解決方案1:

我根據techarena論壇適應症卡爾文證明了最好的和正確的解決方案。

  • 單擊開始,單擊運行,在打開框中鍵入sysdm.cpl,然後按回車鍵 。
  • 單擊「高級」選項卡,然後在「性能」下單擊「設置」。
  • 單擊高級選項卡,然後在虛擬內存下單擊更改。
  • 在驅動器[卷標]下,單擊包含您要更改 的分頁文件的驅動器。
  • 在所選驅動器的頁面文件大小下,單擊自定義大小,在初始大小(MB)或最大大小(MB)框中鍵入新的頁面文件大小(兆字節),然後單擊設置。
  • 單擊確定關閉對話框並應用更改。

這個通常的錯誤「無法分配內存:1455」將由虛擬內存分配引起。以這種方式解決了根C盤的虛擬內存分配後,您應該在Eclipse的控制檯讀取,如下:

[2011-11-27 12:33:06 - Videotutorial1] ------------------------------ 
[2011-11-27 12:33:06 - Videotutorial1] Android Launch! 
[2011-11-27 12:33:06 - Videotutorial1] adb is running normally. 
[2011-11-27 12:33:06 - Videotutorial1] Performing com.videotutoriales.videotutorial1.Videotutorial1Activity activity launch 
[2011-11-27 12:33:06 - Videotutorial1] Automatic Target Mode: Preferred AVD 'VtAVD' is not available. Launching new emulator. 
[2011-11-27 12:33:06 - Videotutorial1] Launching a new emulator with Virtual Device 'VtAVD' 
[2011-11-27 12:33:39 - Emulator] emulator: emulator window was out of view and was recentered 
[2011-11-27 12:33:39 - Emulator] 
[2011-11-27 12:33:45 - Videotutorial1] New emulator found: emulator-5554 
[2011-11-27 12:33:45 - Videotutorial1] Waiting for HOME ('android.process.acore') to be launched... 
[2011-11-27 12:38:19 - Videotutorial1] HOME is up on device 'emulator-5554' 
[2011-11-27 12:38:19 - Videotutorial1] Uploading Videotutorial1.apk onto device 'emulator-5554' 
[2011-11-27 12:38:20 - Videotutorial1] Installing Videotutorial1.apk... 
[2011-11-27 12:40:52 - Videotutorial1] Success! 
[2011-11-27 12:40:53 - Videotutorial1] Starting activity com.videotutoriales.videotutorial1.Videotutorial1Activity on device emulator-5554 
[2011-11-27 12:41:18 - Videotutorial1] Attempting to connect debugger to 'com.videotutoriales.videotutorial1' on port 8628 

解決方案2:

打開Android虛擬設備管理器添加或更改值器件RAM大小15或小的值或更高:

enter image description here

+0

第一個沒有幫助。嘗試第二個,模擬器確實出現,但它仍然停留在屏幕上,並顯示「ANDROID」 –

+0

如果您想在Android模擬器上測試您的應用程序,則需要等待幾分鐘時間才能加載新的模擬器。 – Ponmalar

+0

http://androidbook.blogspot.in/2011/03/tip-speeding-up-your-android-emulator.html – Ponmalar