element-hq / element-ios

A glossy Matrix collaboration client for iOS
https://element.io
GNU Affero General Public License v3.0
1.73k stars 499 forks source link

type argument 'MXEventTimeline' must be a pointer (requires a '*') #5515

Open almohajer opened 2 years ago

almohajer commented 2 years ago

Steps to reproduce

I am trying to run the app in the simulator using XCode 13.2.1 but there are many compilation errors type argument 'MXEventTimeline' must be a pointer (requires a '*')

*/Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.h:141:36: error: type argument 'MXEventTimeline' must be a pointer (requires a '') @property (nonatomic, readonly) id timeline; ^ RiotShareExtension/SupportingFiles/RiotShareExtension-Bridging-Header.h:11:9: note: in file included from /RiotShareExtension/SupportingFiles/RiotShareExtension-Bridging-Header.h:11:

import "MatrixKit-Bridging-Header.h"

    ^

Riot/Modules/MatrixKit/MatrixKit-Bridging-Header.h:17:9: note: in file included from Riot/Modules/MatrixKit/MatrixKit-Bridging-Header.h:17:

import "MXKRoomBubbleCellData.h"

    ^

Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.h:19:9: note: in file included from Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellData.h:19:

import "MXKRoomBubbleCellDataStoring.h"

    ^

Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellDataStoring.h:22:9: note: in file included from Gruups/Riot/Modules/MatrixKit/Models/Room/MXKRoomBubbleCellDataStoring.h:22:

import "MXKRoomDataSource.h"

    ^

Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.h:141:33: error: type arguments cannot be applied to non-class type 'id' @property (nonatomic, readonly) id timeline; ^ 70 warnings and 2 errors generated.

:0: error: failed to emit precompiled header '/Users/ME/Library/Developer/Xcode/DerivedData/Riot-dgpjusukzwlvqodxhbxfowkcvgxz/Build/Intermediates.noindex/PrecompiledHeaders/RiotShareExtension-Bridging-Header-swift_U1TV831HGGKF-clang_2MF8QROC008Q5.pch' for bridging header '**RiotShareExtension/SupportingFiles/RiotShareExtension-Bridging-Header.h' ### Outcome #### What did you expect? i am just trying to compile the app #### What happened instead? i cannot i think it is related to the Xcode version ### Your phone model _No response_ ### Operating system version _No response_ ### Application version _No response_ ### Homeserver _No response_ ### Will you send logs? Yes
stefanceriu commented 2 years ago

I'm not entirely sure what this is but we have no problems building the app on our side or on the CI. MXEventTimeline is a protocol and using it as id<MXEventTimeline> is correct.

You also seem to be using a different version of the code: Property (nonatomic, readonly) id timeline; - needs a lower case P and MXEventTimeline conformance as per https://github.com/vector-im/element-ios/blob/develop/Riot/Modules/MatrixKit/Models/Room/MXKRoomDataSource.h#L141

If that still doesn't do the trick try the usual: clear your derived data, delete your pods folder, run xcode gen, run pod install and try again.