I have fixed the bug by uninstalling whole Visual Studio (2012 & 2013) and Windows Phone 8 SDK. Then install back Visual Studio 2012 and Windows Phone 8 SDK again.
I think that the bug happened when more than 1 Visual Studio installed on the same computer.
Old thread:
i can't deploy an app into my phone
it said "optimization failed with error 1104" when i deploying, and this show at the output
1>------ Deploy started: Project: PhoneApp1, Configuration: Debug Any CPU ------
1>Deployment of application to device failed.
1>Error: Cancelled
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
i create a new wp8 app and deploy it, it show the same error too
EDIT NEW: i have fixed the "A specified communication resource (port) is already in use by another application" bug by running XdeCleanup.exe and restart computer, now it left error 1104
NEW OUTPUT:
NuGet package restore started.
Restoring NuGet packages for solution C:\Users\--\documents\visual studio 2012\Projects\---\---.sln.
NuGet Package restored finished for solution C:\Users\--\documents\visual studio 2012\Projects\---\---.sln.
Restoring NuGet packages for project ---.
Restoring NuGet packages listed in file C:\Users\--\documents\visual studio 2012\Projects\---\---\packages.config.
Skipping NuGet package WPtoolkit 4.2013.08.16 since it is already installed.
NuGet Package restored finished for project ---.
All packages are already installed and there is nothing to restore.
NuGet package restore finished.
1>------ Deploy started: Project: ---, Configuration: Debug Any CPU ------
1>Deployment of application to device failed.
1>Error: Cancelled
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========
--------
this error happen after i fix "LocalizedString" bug (by delete all folders inside %localappdata%\Microsoft\Phone Tools\CoreCon)
it show "LocalizedString" at before deploying this happened during i screenshot, it doesn't appear after i clean the build
visual studio deploy has only "start" option, there is error before and after I deploying, please view the image Fixed by uninstall and install wp8 sdk
computer spec: windows 7, intel atom CPU N2600 1.6GHz
PS: i only debug app to my phone, not via emulator