It happened to be few times. I use the below script and it worked for me at all Times.
Execute SP_ReplicationDbOption Adventureworks2012,Publish,true,1
GO
DBCC ShrinkFile(Adventureworks2012_log,1, Truncate only)
GO
Execute SP_ReplicationDbOption Adventureworks2012,Publish,false,1
GO