I am going to start updating this to help those seeking to use this as reference for their own personal code.
Newest update
I got this error while using one device on 5.0.1 beta 1 and one on 5.0.0.
I got rid of the error by changing the name of the iCloud Container. In the iCloud Containers list, the first one has to match your app ID, but you can add additional containers with different names.
(Like slev's solution of changing the app ID, this is only a good solution if the app hasn't been released yet.)