Search code examples
iosswiftcocoapodsrealm

Unknown property attribute 'class' after Realm-Swift CocoaPod import


I'm new to Xcode and Swift. Today I started a blank Tabbed Application with swift called "Test". I can build the blank project but as soon as I try to add Realm via CocoaPod it doesn't build anymore.

Error: Unknown property attribute 'class'
File: Test/Pods/Realm/Realm/RLMSyncSession.mm:73:12:
CocoaPod version: 1.2.0
Xcode version: Version 7.3.1 
Realm: 2.4.3

I did the pod init/update/install PodFile:

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'Test' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for Test
  pod 'RealmSwift'

  target 'TestTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

After the install I opened the "Test.xcworkspace" file and tried to build the project but it fails. How to fix that?


Solution

  • The issue came from an outdated version of Xcode.

    This causes the OP to not achieve his build and Cocoapods setup after adding Realm to his project.

    After updated it to the last version (8.2.1 I suppose), as recommended in the comment, the pod mechanism worked and the build could finally be achieved.