google-api-objectivec-client-for-rest: Swift Package Manager Support is broken
I have added the dependency for GoogleAPIClientForREST_Drive
in a completely new and clean project using the Swift Package Manager in Xcode. An import GoogleAPIClientForREST_Drive
fails with: Could not build Objective-C module 'GoogleAPIClientForREST_Drive'
. And there is also the error: 'GTLRService.h' file not found'
in the file GTLRDriveService.h
. Shouldn’t it actually use the conditional import @import GoogleAPIClientForRESTCore;
here?
#if SWIFT_PACKAGE || GTLR_USE_MODULAR_IMPORT
@import GoogleAPIClientForRESTCore;
#elif GTLR_BUILT_AS_FRAMEWORK
#import "GTLR/GTLRService.h
#else
#import "GTLRService.h
#endif
Based on the comment from cassareh (#351), I could fix it manually. Is this really necessary or is there another way to do it automatically? If there is no other possibility, we should probably point this out in the README, because in my opinion this is not obvious.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 27 (15 by maintainers)
Commits related to this issue
- sample project for issue: https://github.com/google/google-api-objectivec-client-for-rest/issues/400 — committed to phil1995/GoogleDriveSPMTest by phil1995 4 years ago
- Update GoogleAPIClientForREST to 2.0.0 which fixes SWIFT_PACKAGE issue https://github.com/google/google-api-objectivec-client-for-rest/issues/400 — committed to ashchan/mail-notifr by ashchan 2 years ago
Running the following command under
GoogleAPIClientForREST
project root directory:Will generated an Xcode project that contain the following
Preprocessor Macros
:For Debug configuration:
SWIFT_PACKAGE=1
DEBUG=1
For Release configuration:
SWIFT_PACKAGE=1
The flags above should be added to fix the issue until Xcode get fixed.
fyi - we’re getting close to cutting a 2.0 release that reshuffles the source and should hopefully resolve these issues once and for all.
(the 2.0 version will be because the reshuffle could break some specific setups for imports, but we’re trying to make the changes minimal)
Hello, Same issue for me after adding this library with SPM (core + youtube) :
I stay on cocoapods since this is not fixed 😃