UNEXPECTED TOP-LEVEL EXCEPTION class name does not match path

I’ve just upgraded from Unity 3 to 4 and now am unable to build with the error below. It notes that

class name (com/companyname/unity/ad/R$attr) does not match path (bin/com/companyname/unity/ad/R$attr.class)

They clearly don’t match (class name is missing bin) but how is that fixed?

Full Error

Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
C:\Program Files\Java\jdk1.7.0_55\bin\java.exe -Xmx1024M -Dcom.android.sdkmanager.toolsdir="C:/Program Files (x86)/Android/android-sdk	ools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" -

stderr[

UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dx.cf.iface.ParseException: class name (com/companyname/unity/ad/R$attr) does not match path (bin/com/companyname/unity/ad/R$attr.class)
	at com.android.dx.cf.direct.DirectClassFile.parse0(DirectClassFile.java:520)
	at com.android.dx.cf.direct.DirectClassFile.parse(DirectClassFile.java:406)
...

Fixed!

It was an old .jar sitting in the \Assets\Plugins\Android\ folder. I found it by simply searching for the string “companyname/unity/ad/” through all files. Deleted it and everything builds fine now.