Skip to content

Commit

Permalink
[dev-client][updates] fix ios use_frameworks build errors (expo#23218)
Browse files Browse the repository at this point in the history
# Why

fix ios use_frameworks with expo-dev-client and expo-updates
fixes expo#23190 
close ENG-9158

# How

- [dev-launcher][dev-menu] remove bridging headers. bridging headers are only supported in app projects as far as i know.
- [dev-launcher][dev-menu] remove double quoted imports
- [manifests][updates-interface] remove the swift generated header copying to PODS_ROOT. if we did that, xcode will have ambiguous imports that import from non-module header.

# Test Plan

- ci passed
- versioned expo go
- bare-expo
- sdk49 project + use_frameworks! static
  • Loading branch information
Kudo authored Jun 30, 2023
1 parent 63c08d9 commit a61b5e5
Show file tree
Hide file tree
Showing 35 changed files with 96 additions and 99 deletions.
8 changes: 4 additions & 4 deletions apps/bare-expo/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1377,13 +1377,13 @@ SPEC CHECKSUMS:
EXInAppPurchases: e55f38bce3cb6b70f57d361458c897b17196448d
EXJSONUtils: 09273cf1b6a6bedc5bdae06121011123815c7f32
EXLocation: 231f4a3683fabfed254c9498b226f7f40a40f9d8
EXManifests: 083496dbda4035c42608ae76970f463b4611b767
EXManifests: ff19883eb51c38b8fd2e80d8389fe931e993f3e6
EXMediaLibrary: dd08edb824ee92519a989211720956cfd381f212
EXNotifications: 09394cbd7165f9a4a00a53328aa09bf874bae717
EXPermissions: 336b5b8409f4e1368a8b0636f04282e7f04ced3b
Expo: 9e72fb8ba10f6ee5e95745f69a845b16bceeef00
expo-dev-client: 95aec73a232c2bcc4dab2f06f5ba1ae65967fa4f
expo-dev-launcher: 6a5c2bc04d52a2b4208a1ca3540daedc88c73723
expo-dev-launcher: aea569ba12a2c2e687eceb01fb7d23c9747b174d
expo-dev-menu: ff9a3b8043c61359a722abf4494a41de41cffdc7
expo-dev-menu-interface: bda969497e73dadc2663c479e0fa726ca79a306e
ExpoAppleAuthentication: 7bdf1a2962ebfe9b00eb4183a17b78d736e57185
Expand Down Expand Up @@ -1428,7 +1428,7 @@ SPEC CHECKSUMS:
EXSplashScreen: 04ae8fa26b4954c6a49780c5653860a3613db4a4
EXStructuredHeaders: 324cc3130571d2696357fafd8be7fd9a0b5fdf6e
EXTaskManager: f1730c315eb6fe457a3a2ee4ed899a51d717f302
EXUpdatesInterface: 65a425322c67e3c96952b47ac110df3fef65c6b3
EXUpdatesInterface: bb7e6a992251f4b88a68adc10c3e7d3e42bfb566
FBLazyVector: bb17efca94c43508cbe54fb0a35e36df30da5213
FBReactNativeSpec: a3b5091f783afa7bd795ed63749b469556099181
fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9
Expand Down Expand Up @@ -1514,6 +1514,6 @@ SPEC CHECKSUMS:
Yoga: 1d6727ed193122f6adaf435c3de1a768326ff83b
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: 49c132781c105867a55ae7ef111bc2c6c2a9eddd
PODFILE CHECKSUM: 928d55e6ab5b393766110ddf49df49b883eddd0b

COCOAPODS: 1.12.1
7 changes: 7 additions & 0 deletions ios/Exponent/Kernel/ReactAppManager/EXReactAppManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
#import <ExpoModulesCore/EXModuleRegistryProvider.h>
#import <EXConstants/EXConstantsService.h>
#import <EXSplashScreen/EXSplashScreenService.h>

// When `use_frameworks!` is used, the generated Swift header is inside modules.
// Otherwise, it's available only locally with double-quoted imports.
#if __has_include(<EXManifests/EXManifests-Swift.h>)
#import <EXManifests/EXManifests-Swift.h>
#else
#import "EXManifests-Swift.h"
#endif

#import <React/RCTBridge.h>
#import <React/RCTCxxBridgeDelegate.h>
Expand Down
7 changes: 7 additions & 0 deletions ios/Exponent/Versioned/Core/EXVersionManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@
#import <ExpoModulesCore/EXNativeModulesProxy.h>
#import <EXMediaLibrary/EXMediaLibraryImageLoader.h>
#import <EXFileSystem/EXFileSystem.h>

// When `use_frameworks!` is used, the generated Swift header is inside modules.
// Otherwise, it's available only locally with double-quoted imports.
#if __has_include(<EXManifests/EXManifests-Swift.h>)
#import <EXManifests/EXManifests-Swift.h>
#else
#import "EXManifests-Swift.h"
#endif

#import <RNReanimated/REAModule.h>
#import <RNReanimated/REAEventDispatcher.h>
Expand Down
4 changes: 2 additions & 2 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4904,7 +4904,7 @@ SPEC CHECKSUMS:
EXImageLoader: 34b214f9387e98f3c73989f15d8d5b399c9ab3f7
EXJSONUtils: 09273cf1b6a6bedc5bdae06121011123815c7f32
EXLocation: 231f4a3683fabfed254c9498b226f7f40a40f9d8
EXManifests: 083496dbda4035c42608ae76970f463b4611b767
EXManifests: ff19883eb51c38b8fd2e80d8389fe931e993f3e6
EXMediaLibrary: dd08edb824ee92519a989211720956cfd381f212
EXNotifications: 09394cbd7165f9a4a00a53328aa09bf874bae717
EXPermissions: 336b5b8409f4e1368a8b0636f04282e7f04ced3b
Expand Down Expand Up @@ -4950,7 +4950,7 @@ SPEC CHECKSUMS:
EXStructuredHeaders: 324cc3130571d2696357fafd8be7fd9a0b5fdf6e
EXTaskManager: f1730c315eb6fe457a3a2ee4ed899a51d717f302
EXUpdates: fa9eed08c743d34b18f21f526893645ff16eb246
EXUpdatesInterface: 65a425322c67e3c96952b47ac110df3fef65c6b3
EXUpdatesInterface: bb7e6a992251f4b88a68adc10c3e7d3e42bfb566
FBAEMKit: c7efe06720a8b15b1d25b68921ba46dee20996e0
FBAudienceNetwork: e0fcc9091fced34910ed0b6da06f129db46ac9e6
FBLazyVector: bb17efca94c43508cbe54fb0a35e36df30da5213
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@
#import <ABI49_0_0ExpoModulesCore/ABI49_0_0EXNativeModulesProxy.h>
#import <ABI49_0_0EXMediaLibrary/ABI49_0_0EXMediaLibraryImageLoader.h>
#import <ABI49_0_0EXFileSystem/ABI49_0_0EXFileSystem.h>

// When `use_frameworks!` is used, the generated Swift header is inside modules.
// Otherwise, it's available only locally with double-quoted imports.
#if __has_include(<ABI49_0_0EXManifests/ABI49_0_0EXManifests-Swift.h>)
#import <ABI49_0_0EXManifests/ABI49_0_0EXManifests-Swift.h>
#else
#import "ABI49_0_0EXManifests-Swift.h"
#endif

#import <ABI49_0_0RNReanimated/ABI49_0_0REAModule.h>
#import <ABI49_0_0RNReanimated/ABI49_0_0REAEventDispatcher.h>
Expand Down
1 change: 1 addition & 0 deletions packages/expo-dev-launcher/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### 🐛 Bug fixes

- Enable network inspector by default even the `EX_DEV_CLIENT_NETWORK_INSPECTOR` property is not defined. ([#23185](https://github.com/expo/expo/pull/23185) by [@kudo](https://github.com/kudo))
- Fixed iOS build errors in `use_frameworks!` mode. ([#23218](https://github.com/expo/expo/pull/23218) by [@kudo](https://github.com/kudo))

### 💡 Others

Expand Down
11 changes: 9 additions & 2 deletions packages/expo-dev-launcher/expo-dev-launcher.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,25 @@ Pod::Spec.new do |s|
'OTHER_CFLAGS' => other_c_flags,
}

header_search_paths = [
'"$(PODS_ROOT)/Headers/Private/React-Core"',
'"${PODS_ROOT}/Headers/Public/RNReanimated"',
'"$(PODS_CONFIGURATION_BUILD_DIR)/EXManifests/Swift Compatibility Header"',
'"$(PODS_CONFIGURATION_BUILD_DIR)/EXUpdatesInterface/Swift Compatibility Header"',
]

# Swift/Objective-C compatibility
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'OTHER_CFLAGS[config=Debug]' => other_c_flags,
'OTHER_SWIFT_FLAGS[config=Debug]' => other_swift_flags,
"HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/Headers/Private/React-Core\" \"$(PODS_ROOT)/Headers/Public/RNReanimated\"",
'HEADER_SEARCH_PATHS' => header_search_paths.join(' '),
'FRAMEWORK_SEARCH_PATHS' => '"${PODS_CONFIGURATION_BUILD_DIR}/RNReanimated"',
"CLANG_CXX_LANGUAGE_STANDARD" => "c++17",
}

s.user_target_xcconfig = {
"HEADER_SEARCH_PATHS" => "\"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-launcher/Swift Compatibility Header\"",
'HEADER_SEARCH_PATHS' => '"${PODS_CONFIGURATION_BUILD_DIR}/expo-dev-launcher/Swift Compatibility Header"',
}

s.dependency "React-Core"
Expand Down
4 changes: 2 additions & 2 deletions packages/expo-dev-launcher/ios/EXDevLauncher.m
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2015-present 650 Industries. All rights reserved.

#import "EXDevLauncher.h"
#import "EXDevLauncherController.h"
#import <EXDevLauncher/EXDevLauncher.h>
#import <EXDevLauncher/EXDevLauncherController.h>

#if __has_include(<EXDevLauncher/EXDevLauncher-Swift.h>)
// For cocoapods framework, the generated swift header will be inside EXDevLauncher module
Expand Down
4 changes: 2 additions & 2 deletions packages/expo-dev-launcher/ios/EXDevLauncherBridgeDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#import "EXDevLauncherBridgeDelegate.h"
#import "EXDevLauncherController.h"
#import <EXDevLauncher/EXDevLauncherBridgeDelegate.h>
#import <EXDevLauncher/EXDevLauncherController.h>

#import <React/RCTBundleURLProvider.h>
#if __has_include(<React_RCTAppDelegate/RCTAppSetupUtils.h>)
Expand Down
10 changes: 10 additions & 0 deletions packages/expo-dev-launcher/ios/EXDevLauncherController.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,18 @@

#import <UIKit/UIKit.h>

// When `use_frameworks!` is used, the generated Swift header is inside modules.
// Otherwise, it's available only locally with double-quoted imports.
#if __has_include(<EXUpdatesInterface/EXUpdatesInterface-Swift.h>)
#import <EXUpdatesInterface/EXUpdatesInterface-Swift.h>
#else
#import "EXUpdatesInterface-Swift.h"
#endif
#if __has_include(<EXManifests/EXManifests-Swift.h>)
#import <EXManifests/EXManifests-Swift.h>
#else
#import "EXManifests-Swift.h"
#endif

NS_ASSUME_NONNULL_BEGIN

Expand Down
18 changes: 9 additions & 9 deletions packages/expo-dev-launcher/ios/EXDevLauncherController.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
#import <React/RCTConstants.h>
#import <React/RCTKeyCommands.h>

#import "EXDevLauncherController.h"
#import "EXDevLauncherRCTBridge.h"
#import "EXDevLauncherManifestParser.h"
#import "EXDevLauncherLoadingView.h"
#import "EXDevLauncherRCTDevSettings.h"
#import "EXDevLauncherUpdatesHelper.h"
#import "RCTPackagerConnection+EXDevLauncherPackagerConnectionInterceptor.h"

#import "EXDevLauncherBridgeDelegate.h"
#import <EXDevLauncher/EXDevLauncherController.h>
#import <EXDevLauncher/EXDevLauncherRCTBridge.h>
#import <EXDevLauncher/EXDevLauncherManifestParser.h>
#import <EXDevLauncher/EXDevLauncherLoadingView.h>
#import <EXDevLauncher/EXDevLauncherRCTDevSettings.h>
#import <EXDevLauncher/EXDevLauncherUpdatesHelper.h>
#import <EXDevLauncher/RCTPackagerConnection+EXDevLauncherPackagerConnectionInterceptor.h>

#import <EXDevLauncher/EXDevLauncherBridgeDelegate.h>

#if __has_include(<EXDevLauncher/EXDevLauncher-Swift.h>)
// For cocoapods framework, the generated swift header will be inside EXDevLauncher module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#import "EXDevLauncherController.h"
#import <EXDevLauncher/EXDevLauncherController.h>

@import EXDevMenuInterface;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2021-present 650 Industries. All rights reserved.

#import "EXDevLauncherUpdatesHelper.h"
#import <EXDevLauncher/EXDevLauncherUpdatesHelper.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-present 650 Industries. All rights reserved.

#import "EXRCTAppDelegateInterceptor.h"
#import <EXDevLauncher/EXRCTAppDelegateInterceptor.h>

#import <memory>
#import <cxxreact/JSExecutor.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#import <React/RCTRedBox.h>
#import <React/RCTLogBox.h>

#import "EXDevLauncherRedBoxProtocol.h"
#import <EXDevLauncher/EXDevLauncherRedBoxProtocol.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
6 changes: 3 additions & 3 deletions packages/expo-dev-launcher/ios/Errors/EXDevLauncherRedBox.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#import <React/RCTAssert.h>

#import "EXDevLauncherRedBox.h"
#import "EXDevLauncherController.h"
#import <EXDevLauncher/EXDevLauncherRedBox.h>
#import <EXDevLauncher/EXDevLauncherController.h>

#if __has_include(<EXDevLauncher/EXDevLauncher-Swift.h>)
// For cocoapods framework, the generated swift header will be inside EXDevLauncher module
Expand Down Expand Up @@ -140,7 +140,7 @@ - (void)showErrorMessage:(NSString *)message
// These errors should be handled by LogBox
return;
}

// hide method was removed from the RCTLogBox interface in RN 0.64
if ([self.logBox respondsToSelector:@selector(hide)]) {
[self.logBox performSelector:@selector(hide)];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright 2015-present 650 Industries. All rights reserved.

#import "EXDevLauncherManifestParser.h"
#import "EXDevLauncherController.h"
#import <EXDevLauncher/EXDevLauncherManifestParser.h>
#import <EXDevLauncher/EXDevLauncherController.h>

#if __has_include(<EXDevLauncher/EXDevLauncher-Swift.h>)
// For cocoapods framework, the generated swift header will be inside EXDevLauncher module
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2015-present 650 Industries. All rights reserved.

#import "EXDevLauncherLoadingView.h"
#import <EXDevLauncher/EXDevLauncherLoadingView.h>

#if __has_include(<React/RCTDevLoadingViewProtocol.h>)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Copyright 2015-present 650 Industries. All rights reserved.

#import "EXDevLauncherRCTBridge.h"
#import "EXDevLauncherController.h"
#import "RCTCxxBridge+Private.h"
#import <EXDevLauncher/EXDevLauncherRCTBridge.h>
#import <EXDevLauncher/EXDevLauncherController.h>
#import <EXDevLauncher/RCTCxxBridge+Private.h>

#import <React/RCTPerformanceLogger.h>
#import <React/RCTDevSettings.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2015-present 650 Industries. All rights reserved.

#import "EXDevLauncherRCTDevSettings.h"
#import <EXDevLauncher/EXDevLauncherRCTDevSettings.h>

@implementation EXDevLauncherRCTDevSettings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* This file is compiled without ARC - the memory needs to be managed by hand.
*/

#import "RCTPackagerConnection+EXDevLauncherPackagerConnectionInterceptor.h"
#import <EXDevLauncher/RCTPackagerConnection+EXDevLauncherPackagerConnectionInterceptor.h>

#import <React/RCTReconnectingWebSocket.h>

Expand Down
15 changes: 0 additions & 15 deletions packages/expo-dev-launcher/ios/expo-dev-launcher-Bridging-Header.h

This file was deleted.

1 change: 1 addition & 0 deletions packages/expo-dev-menu/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
### 🐛 Bug fixes

- Fixed the `Cannot read property 'addDevMenuCallbacks' of null` error when registering custom menu item on iOS. ([#23219](https://github.com/expo/expo/pull/23219) by [@kudo](https://github.com/kudo))
- Fixed iOS build errors in `use_frameworks!` mode. ([#23218](https://github.com/expo/expo/pull/23218) by [@kudo](https://github.com/kudo))

### 💡 Others

Expand Down
5 changes: 5 additions & 0 deletions packages/expo-dev-menu/expo-dev-menu.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ Pod::Spec.new do |s|
'"$(PODS_CONFIGURATION_BUILD_DIR)/ExpoModulesCore/Swift Compatibility Header"',
'"$(PODS_CONFIGURATION_BUILD_DIR)/expo-dev-menu-interface/Swift Compatibility Header"',
]
if ENV['USE_FRAMEWORKS']
header_search_paths.concat([
'"${PODS_CONFIGURATION_BUILD_DIR}/React-runtimescheduler/React_runtimescheduler.framework/Headers"',
])
end
s.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
Expand Down
3 changes: 1 addition & 2 deletions packages/expo-dev-menu/ios/DevClientAppDelegate.mm
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#import "DevClientAppDelegate.h"
#import "EXDevLauncherController.h"
#import <EXDevMenu/DevClientAppDelegate.h>

#import <React/RCTBundleURLProvider.h>
#import <React/RCTRuntimeExecutorFromBridge.h>
Expand Down
2 changes: 1 addition & 1 deletion packages/expo-dev-menu/ios/DevMenuLoadingView.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2015-present 650 Industries. All rights reserved.

#import "DevMenuLoadingView.h"
#import <EXDevMenu/DevMenuLoadingView.h>

#if __has_include(<React/RCTDevLoadingViewProtocol.h>)

Expand Down
2 changes: 1 addition & 1 deletion packages/expo-dev-menu/ios/DevMenuRCTBridge.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#import <React/RCTBridge+Private.h>

#import "DevClientAppDelegate.h"
#import <EXDevMenu/DevClientAppDelegate.h>

NS_ASSUME_NONNULL_BEGIN

Expand Down
2 changes: 1 addition & 1 deletion packages/expo-dev-menu/ios/DevMenuRCTDevSettings.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2015-present 650 Industries. All rights reserved.

#import "DevMenuRCTDevSettings.h"
#import <EXDevMenu/DevMenuRCTDevSettings.h>

@implementation DevMenuRCTDevSettings

Expand Down
2 changes: 1 addition & 1 deletion packages/expo-dev-menu/ios/EXDevMenuAppInfo.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2015-present 650 Industries. All rights reserved.
#import "EXDevMenuAppInfo.h"
#import <EXDevMenu/EXDevMenuAppInfo.h>
#import <React/RCTBridge+Private.h>
#if __has_include(<EXDevMenu/EXDevMenu-Swift.h>)
#import <EXDevMenu/EXDevMenu-Swift.h>
Expand Down
25 changes: 0 additions & 25 deletions packages/expo-dev-menu/ios/Headers/EXDevMenu-Bridging-Header.h

This file was deleted.

Loading

0 comments on commit a61b5e5

Please sign in to comment.