Xcode 12 Beta 6: 'AppDelegate' has different definitions in different modules

1.7k views Asked by At

On launching my existing project with Xcode 12 Beta 6 - it does not allow to compile saying:

AST Deserialization Issue:

'AppDelegate' has different definitions in different modules; first difference is defined here found 2 referenced protocols

What I have confirmed is - @interface AppDelegate exist only once in my workspace, so where do we find second definition of AppDelegate?

Anyone else has faced this or any hint on this?

1

There are 1 answers

0
AudioBubble On

This issue happened to me recently after upgrading to Xcode 12.

The Issue is caused by a duplicate AppDelegate file in the project (usually by Pods)

Here is the solution that worked for me.

  1. Try (Command + Shift + O) and search for AppDelegate.
  2. If you find any AppDelegates under pods packages, you need to unlock them and remove the AppDelegate declaration from there.
  3. Instead of removing it, you can also uncheck the target membership for that file from the Target Membership menu on the right.

Until the Pod owner fixes the issue, you may need to fork the pod repo causing the issue, remove the AppDelegate from your forked instance and then use your repo in your Podfile instead.

example:

pod 'PhoneNumberKit', :git => 'https://github.com/ameedsayeh/PhoneNumberKit.git'