Skip to content

Commit 06e9b8a

Browse files
authored
fix(ios): fix ios not building when using use_frameworks with static linkage (#34)
1 parent 277a476 commit 06e9b8a

File tree

9 files changed

+64
-32
lines changed

9 files changed

+64
-32
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ jobs:
8383
- name: Setup
8484
uses: ./.github/actions/setup
8585

86+
# Use java 17:
87+
- name: Setup Java
88+
uses: actions/setup-java@v3
89+
with:
90+
distribution: "adopt"
91+
java-version: "17"
92+
8693
- name: Build Android
8794
run: cd example && npx react-native build-android --mode=debug
8895

@@ -100,15 +107,16 @@ jobs:
100107
- name: Setup
101108
uses: ./.github/actions/setup
102109

110+
# Use java 17:
111+
- name: Setup Java
112+
uses: actions/setup-java@v3
113+
with:
114+
distribution: "adopt"
115+
java-version: "17"
116+
103117
- name: Build Android
104118
run: cd example && npx react-native build-android --mode=release
105119

106-
# - name: Setup Java
107-
# uses: actions/setup-java@v3
108-
# with:
109-
# distribution: "oracle"
110-
# java-version: "17"
111-
112120
ios-debug:
113121
runs-on: macos-latest
114122
defaults:
@@ -134,5 +142,5 @@ jobs:
134142
working-directory: ./package/example/ios
135143

136144
- name: Build iOS
137-
run: yes | npx react-native build-ios --configuration Debug
145+
run: yes | npx react-native build-ios --mode Debug
138146
working-directory: ./package/example

package/android/cpp/jni/include/JniSkiaSkottieView.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#include <jni.h>
88
#include <jsi/jsi.h>
99

10-
#include <react-native-skia/JniSkiaBaseView.h>
11-
#include <react-native-skia/JniSkiaManager.h>
12-
#include <react-native-skia/RNSkAndroidView.h>
10+
#include "JniSkiaBaseView.h"
11+
#include "JniSkiaManager.h"
12+
#include "RNSkAndroidView.h"
1313

1414
#include <android/native_window.h>
1515
#include <android/native_window_jni.h>

package/cpp/JsiSkSkottie.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#include <jsi/jsi.h>
44

5-
#include <react-native-skia/JsiSkCanvas.h>
6-
#include <react-native-skia/JsiSkHostObjects.h>
5+
#include "JsiSkCanvas.h"
6+
#include "JsiSkHostObjects.h"
77

88
#pragma clang diagnostic push
99
#pragma clang diagnostic ignored "-Wdocumentation"

package/cpp/RNSkSkottieView.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010

1111
#include <jsi/jsi.h>
1212

13-
#include <react-native-skia/JsiSkPicture.h>
14-
#include <react-native-skia/JsiValueWrapper.h>
15-
#include <react-native-skia/RNSkInfoParameter.h>
16-
#include <react-native-skia/RNSkLog.h>
17-
#include <react-native-skia/RNSkPlatformContext.h>
18-
#include <react-native-skia/RNSkView.h>
13+
#include "JsiSkPicture.h"
14+
#include "JsiValueWrapper.h"
15+
#include "RNSkInfoParameter.h"
16+
#include "RNSkLog.h"
17+
#include "RNSkPlatformContext.h"
18+
#include "RNSkView.h"
1919

2020
#include "JsiSkSkottie.h"
2121
#include "RNSkTime.h"

package/cpp/react-native-skia-skottie.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

3+
#include "RNSkPlatformContext.h"
34
#include <jsi/jsi.h>
4-
#include <react-native-skia/RNSkPlatformContext.h>
55

66
namespace RNSkia {
77
using namespace facebook;

package/example/ios/SkiaSkottieExample.xcodeproj/project.pbxproj

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
1212
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
1313
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14-
3550FEF275B532601FA3A2D1 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B6ADDB42D15ED0B5396A797 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */; };
14+
636BDB20ACBD5B04CE2F4236 /* libPods-SkiaSkottieExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E7A6E38922BDCF9DF66424 /* libPods-SkiaSkottieExample.a */; };
1515
6AF902BEC9C0D526D0F0FEAC /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 8597BB3647B41582B7EE2B95 /* PrivacyInfo.xcprivacy */; };
1616
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
17-
D59FB581CA39B0F9DD790ADC /* libPods-SkiaSkottieExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 299163CFAF3C3D8FB5A0D822 /* libPods-SkiaSkottieExample.a */; };
17+
9CE03E7C5464CBF413F4281F /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A649F30FE1B90109D355CCC /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */; };
1818
/* End PBXBuildFile section */
1919

2020
/* Begin PBXContainerItemProxy section */
@@ -38,12 +38,12 @@
3838
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SkiaSkottieExample/Images.xcassets; sourceTree = "<group>"; };
3939
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SkiaSkottieExample/Info.plist; sourceTree = "<group>"; };
4040
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SkiaSkottieExample/main.m; sourceTree = "<group>"; };
41-
1B6ADDB42D15ED0B5396A797 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
42-
299163CFAF3C3D8FB5A0D822 /* libPods-SkiaSkottieExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
41+
4A649F30FE1B90109D355CCC /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4342
6FC810A6FF54600A42A171F2 /* Pods-SkiaSkottieExample-SkiaSkottieExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SkiaSkottieExample-SkiaSkottieExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-SkiaSkottieExample-SkiaSkottieExampleTests/Pods-SkiaSkottieExample-SkiaSkottieExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
4443
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = SkiaSkottieExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
4544
8597BB3647B41582B7EE2B95 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = SkiaSkottieExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
4645
AB8D8DE14F8E215D2F0F440D /* Pods-SkiaSkottieExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SkiaSkottieExample.debug.xcconfig"; path = "Target Support Files/Pods-SkiaSkottieExample/Pods-SkiaSkottieExample.debug.xcconfig"; sourceTree = "<group>"; };
46+
D8E7A6E38922BDCF9DF66424 /* libPods-SkiaSkottieExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4747
DFB707D8DFDB91273C7F271D /* Pods-SkiaSkottieExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SkiaSkottieExample.release.xcconfig"; path = "Target Support Files/Pods-SkiaSkottieExample/Pods-SkiaSkottieExample.release.xcconfig"; sourceTree = "<group>"; };
4848
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
4949
/* End PBXFileReference section */
@@ -53,15 +53,15 @@
5353
isa = PBXFrameworksBuildPhase;
5454
buildActionMask = 2147483647;
5555
files = (
56-
3550FEF275B532601FA3A2D1 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */,
56+
9CE03E7C5464CBF413F4281F /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */,
5757
);
5858
runOnlyForDeploymentPostprocessing = 0;
5959
};
6060
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
6161
isa = PBXFrameworksBuildPhase;
6262
buildActionMask = 2147483647;
6363
files = (
64-
D59FB581CA39B0F9DD790ADC /* libPods-SkiaSkottieExample.a in Frameworks */,
64+
636BDB20ACBD5B04CE2F4236 /* libPods-SkiaSkottieExample.a in Frameworks */,
6565
);
6666
runOnlyForDeploymentPostprocessing = 0;
6767
};
@@ -103,8 +103,8 @@
103103
isa = PBXGroup;
104104
children = (
105105
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
106-
299163CFAF3C3D8FB5A0D822 /* libPods-SkiaSkottieExample.a */,
107-
1B6ADDB42D15ED0B5396A797 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */,
106+
D8E7A6E38922BDCF9DF66424 /* libPods-SkiaSkottieExample.a */,
107+
4A649F30FE1B90109D355CCC /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */,
108108
);
109109
name = Frameworks;
110110
sourceTree = "<group>";
@@ -587,6 +587,17 @@
587587
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
588588
GCC_WARN_UNUSED_FUNCTION = YES;
589589
GCC_WARN_UNUSED_VARIABLE = YES;
590+
HEADER_SEARCH_PATHS = (
591+
"$(inherited)",
592+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
593+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
594+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
595+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
596+
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
597+
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
598+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
599+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
600+
);
590601
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
591602
LD = "";
592603
LDPLUSPLUS = "";
@@ -663,6 +674,17 @@
663674
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
664675
GCC_WARN_UNUSED_FUNCTION = YES;
665676
GCC_WARN_UNUSED_VARIABLE = YES;
677+
HEADER_SEARCH_PATHS = (
678+
"$(inherited)",
679+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
680+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
681+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
682+
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
683+
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
684+
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
685+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
686+
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
687+
);
666688
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
667689
LD = "";
668690
LDPLUSPLUS = "";

package/example/ios/SkiaSkottieExample/PrivacyInfo.xcprivacy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
<key>NSPrivacyAccessedAPITypeReasons</key>
2020
<array>
2121
<string>CA92.1</string>
22+
<string>1C8F.1</string>
23+
<string>C56D.1</string>
2224
</array>
2325
</dict>
2426
<dict>

package/example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
"@babel/core": "^7.20.0",
2121
"@babel/preset-env": "^7.20.0",
2222
"@babel/runtime": "^7.20.0",
23+
"@react-native/babel-preset": "0.74.83",
2324
"@react-native/metro-config": "0.74.83",
2425
"babel-plugin-module-resolver": "^4.1.0",
25-
"@react-native/babel-preset": "0.74.83",
2626
"pod-install": "^0.1.39"
2727
},
2828
"engines": {

package/ios/SkiaSkottieViewManager.mm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include "SkiaSkottieViewManager.h"
22
#include <React/RCTBridge+Private.h>
33

4-
#include <RNSkIOSView.h>
5-
#include <RNSkPlatformContext.h>
6-
#include <RNSkSkottieView.h>
4+
#include "RNSkIOSView.h"
5+
#include "RNSkPlatformContext.h"
6+
#include "RNSkSkottieView.h"
77

8+
#include "RNSkiaModule.h"
89
#include "SkiaManager.h"
910
#include "SkiaUIView.h"
10-
#include <RNSkiaModule.h>
1111

1212
@implementation SkiaSkottieViewManager
1313

0 commit comments

Comments
 (0)