Could not create the Java Virtual Machine.


如果在Android 遇到


Could not create the Java Virtual Machine. anan
A fatal exception has occurred. Program will exit. [dx] Error occurred during initialization of VM [dx] Could not reserve enough space for object heap 

  • default SDK 

那就到android-sdks\platform-tools 目錄中的 dx.bat 檔案,
將 set defaultXmx=-Xmx1024M 改為 set  defaultXmx=-Xmx512M

  • 若是自己Build AOSP

在source code裡 修改 /dalvik/dx/etc/dx.bat
將 set defaultXmx=-Xmx1024M 改為 set  defaultXmx=-Xmx512M



其他Android開發相關文章:
更多開發相關討論請見: Android開發豆知識

留言

Google Search

推薦內容橫式

本月熱門文章