Skip to content

Commit

Permalink
fix(ios): fix ios not building when using use_frameworks with static …
Browse files Browse the repository at this point in the history
…linkage (#34)
  • Loading branch information
hannojg authored May 4, 2024
1 parent 277a476 commit 06e9b8a
Show file tree
Hide file tree
Showing 9 changed files with 64 additions and 32 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

# Use java 17:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"

- name: Build Android
run: cd example && npx react-native build-android --mode=debug

Expand All @@ -100,15 +107,16 @@ jobs:
- name: Setup
uses: ./.github/actions/setup

# Use java 17:
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"

- name: Build Android
run: cd example && npx react-native build-android --mode=release

# - name: Setup Java
# uses: actions/setup-java@v3
# with:
# distribution: "oracle"
# java-version: "17"

ios-debug:
runs-on: macos-latest
defaults:
Expand All @@ -134,5 +142,5 @@ jobs:
working-directory: ./package/example/ios

- name: Build iOS
run: yes | npx react-native build-ios --configuration Debug
run: yes | npx react-native build-ios --mode Debug
working-directory: ./package/example
6 changes: 3 additions & 3 deletions package/android/cpp/jni/include/JniSkiaSkottieView.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
#include <jni.h>
#include <jsi/jsi.h>

#include <react-native-skia/JniSkiaBaseView.h>
#include <react-native-skia/JniSkiaManager.h>
#include <react-native-skia/RNSkAndroidView.h>
#include "JniSkiaBaseView.h"
#include "JniSkiaManager.h"
#include "RNSkAndroidView.h"

#include <android/native_window.h>
#include <android/native_window_jni.h>
Expand Down
4 changes: 2 additions & 2 deletions package/cpp/JsiSkSkottie.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

#include <jsi/jsi.h>

#include <react-native-skia/JsiSkCanvas.h>
#include <react-native-skia/JsiSkHostObjects.h>
#include "JsiSkCanvas.h"
#include "JsiSkHostObjects.h"

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
Expand Down
12 changes: 6 additions & 6 deletions package/cpp/RNSkSkottieView.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@

#include <jsi/jsi.h>

#include <react-native-skia/JsiSkPicture.h>
#include <react-native-skia/JsiValueWrapper.h>
#include <react-native-skia/RNSkInfoParameter.h>
#include <react-native-skia/RNSkLog.h>
#include <react-native-skia/RNSkPlatformContext.h>
#include <react-native-skia/RNSkView.h>
#include "JsiSkPicture.h"
#include "JsiValueWrapper.h"
#include "RNSkInfoParameter.h"
#include "RNSkLog.h"
#include "RNSkPlatformContext.h"
#include "RNSkView.h"

#include "JsiSkSkottie.h"
#include "RNSkTime.h"
Expand Down
2 changes: 1 addition & 1 deletion package/cpp/react-native-skia-skottie.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "RNSkPlatformContext.h"
#include <jsi/jsi.h>
#include <react-native-skia/RNSkPlatformContext.h>

namespace RNSkia {
using namespace facebook;
Expand Down
38 changes: 30 additions & 8 deletions package/example/ios/SkiaSkottieExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
3550FEF275B532601FA3A2D1 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1B6ADDB42D15ED0B5396A797 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */; };
636BDB20ACBD5B04CE2F4236 /* libPods-SkiaSkottieExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D8E7A6E38922BDCF9DF66424 /* libPods-SkiaSkottieExample.a */; };
6AF902BEC9C0D526D0F0FEAC /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 8597BB3647B41582B7EE2B95 /* PrivacyInfo.xcprivacy */; };
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
D59FB581CA39B0F9DD790ADC /* libPods-SkiaSkottieExample.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 299163CFAF3C3D8FB5A0D822 /* libPods-SkiaSkottieExample.a */; };
9CE03E7C5464CBF413F4281F /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4A649F30FE1B90109D355CCC /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand All @@ -38,12 +38,12 @@
13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = SkiaSkottieExample/Images.xcassets; sourceTree = "<group>"; };
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = SkiaSkottieExample/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = SkiaSkottieExample/main.m; sourceTree = "<group>"; };
1B6ADDB42D15ED0B5396A797 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
299163CFAF3C3D8FB5A0D822 /* libPods-SkiaSkottieExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
4A649F30FE1B90109D355CCC /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = SkiaSkottieExample/LaunchScreen.storyboard; sourceTree = "<group>"; };
8597BB3647B41582B7EE2B95 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; includeInIndex = 1; name = PrivacyInfo.xcprivacy; path = SkiaSkottieExample/PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
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>"; };
D8E7A6E38922BDCF9DF66424 /* libPods-SkiaSkottieExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-SkiaSkottieExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
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>"; };
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
/* End PBXFileReference section */
Expand All @@ -53,15 +53,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
3550FEF275B532601FA3A2D1 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */,
9CE03E7C5464CBF413F4281F /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
D59FB581CA39B0F9DD790ADC /* libPods-SkiaSkottieExample.a in Frameworks */,
636BDB20ACBD5B04CE2F4236 /* libPods-SkiaSkottieExample.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -103,8 +103,8 @@
isa = PBXGroup;
children = (
ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
299163CFAF3C3D8FB5A0D822 /* libPods-SkiaSkottieExample.a */,
1B6ADDB42D15ED0B5396A797 /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */,
D8E7A6E38922BDCF9DF66424 /* libPods-SkiaSkottieExample.a */,
4A649F30FE1B90109D355CCC /* libPods-SkiaSkottieExample-SkiaSkottieExampleTests.a */,
);
name = Frameworks;
sourceTree = "<group>";
Expand Down Expand Up @@ -587,6 +587,17 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD = "";
LDPLUSPLUS = "";
Expand Down Expand Up @@ -663,6 +674,17 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (
"$(inherited)",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon/ReactCommon.framework/Headers/react/nativemodule/core",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/ReactCommon-Samples/ReactCommon_Samples.framework/Headers/platform/ios",
"${PODS_CONFIGURATION_BUILD_DIR}/React-Fabric/React_Fabric.framework/Headers/react/renderer/components/view/platform/cxx",
"${PODS_CONFIGURATION_BUILD_DIR}/React-NativeModulesApple/React_NativeModulesApple.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers",
"${PODS_CONFIGURATION_BUILD_DIR}/React-graphics/React_graphics.framework/Headers/react/renderer/graphics/platform/ios",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LD = "";
LDPLUSPLUS = "";
Expand Down
2 changes: 2 additions & 0 deletions package/example/ios/SkiaSkottieExample/PrivacyInfo.xcprivacy
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<key>NSPrivacyAccessedAPITypeReasons</key>
<array>
<string>CA92.1</string>
<string>1C8F.1</string>
<string>C56D.1</string>
</array>
</dict>
<dict>
Expand Down
2 changes: 1 addition & 1 deletion package/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@react-native/babel-preset": "0.74.83",
"@react-native/metro-config": "0.74.83",
"babel-plugin-module-resolver": "^4.1.0",
"@react-native/babel-preset": "0.74.83",
"pod-install": "^0.1.39"
},
"engines": {
Expand Down
8 changes: 4 additions & 4 deletions package/ios/SkiaSkottieViewManager.mm
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#include "SkiaSkottieViewManager.h"
#include <React/RCTBridge+Private.h>

#include <RNSkIOSView.h>
#include <RNSkPlatformContext.h>
#include <RNSkSkottieView.h>
#include "RNSkIOSView.h"
#include "RNSkPlatformContext.h"
#include "RNSkSkottieView.h"

#include "RNSkiaModule.h"
#include "SkiaManager.h"
#include "SkiaUIView.h"
#include <RNSkiaModule.h>

@implementation SkiaSkottieViewManager

Expand Down

0 comments on commit 06e9b8a

Please sign in to comment.