Shopify / react-native-skia

High-performance React Native Graphics using Skia
https://shopify.github.io/react-native-skia
MIT License
6.88k stars 443 forks source link

EAS Build fail with react-native-skia #1652

Closed MarcHbb closed 1 year ago

MarcHbb commented 1 year ago

Description

When I install react-native-skia (npx expo install @shopify/react-native-skia) and want to run a new build with eas, I get an error on Fastlane step. Managed to create a build right before install react-native-skia.

Compiling @shopify/react-native-skia Pods/react-native-skia » react_native_skia_vers.c

❌  (node_modules/@shopify/react-native-skia/cpp/skia/include/core/SkStream.h:11:10)

   9 | #define SkStream_DEFINED
  10 | 
> 11 | #include "include/core/SkData.h"
     |          ^ 'include/core/SkData.h' file not found
  12 | #include "include/core/SkRefCnt.h"
  13 | #include "include/core/SkScalar.h"
  14 | #include "include/private/SkTo.h"
    Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the APPNAME editor. (in target 'APPNAME' from project 'APPNAME')
▸ ** BUILD FAILED **
▸ The following build commands failed:
▸   CompileC /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-skia.build/Objects-normal/x86_64/SkiaManager.o /Users/expo/workingdir/build/node_modules/@shopify/react-native-skia/ios/RNSkia-iOS/SkiaManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-skia' from project 'Pods')
▸ (1 failure)
2023-06-18 10:50:11.617 xcodebuild[4303:11763] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2023-06-18 10:50:11.617 xcodebuild[4303:11763] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2023-06-18 10:50:11.658 xcodebuild[4303:11763] XType: failed to connect - Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process.}
2023-06-18 10:50:11.658 xcodebuild[4303:11763] Font server protocol version mismatch (expected:5 got:0), falling back to local fonts
2023-06-18 10:50:11.658 xcodebuild[4303:11763] XType: unable to make a connection to the font daemon!
2023-06-18 10:50:11.658 xcodebuild[4303:11763] XType: XTFontStaticRegistry is enabled as fontd is not available.
** BUILD FAILED **
The following build commands failed:
    CompileC /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-skia.build/Objects-normal/x86_64/SkiaManager.o /Users/expo/workingdir/build/node_modules/@shopify/react-native-skia/ios/RNSkia-iOS/SkiaManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-skia' from project 'Pods')
(1 failure)
Exit status: 65`

XCode Logs :

`Users/expo/workingdir/build/node_modules/@shopify/react-native-skia/cpp/skia/include/core/SkStream.h:11:10: fatal error: 'include/core/SkData.h' file not found

include "include/core/SkData.h"

     ^~~~~~~~~~~~~~~~~~~~~~~

1 error generated.`

Version

"@shopify/react-native-skia": "0.1.141"

Steps to reproduce

Create a build with eas build

Snack, code example, screenshot, or link to a repository

My package.json :

{
  "name": "APPNAME",
  "version": "2.1.2",
  "main": "node_modules/expo/AppEntry.js",
  "scripts": {
    "start": "expo start --clear",
    "dev": "APP_ENV=development npx expo start --dev-client",
    "build:dev": "APP_ENV=development eas build --profile development --clear-cache",
    "build:dev-s": "APP_ENV=development eas build --profile dev-simulator",
    "build:staging-s": "APP_ENV=staging eas build --profile staging-simulator",
    "build:staging": "APP_ENV=staging eas build --profile staging",
    "update:staging": "APP_ENV=staging eas update --branch staging",
    "build:prod": "APP_ENV=production eas build --profile production",
    "build:prod-s": "APP_ENV=production eas build --profile simulator-prod",
    "update:prod": "APP_ENV=production eas update --branch production",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "postinstall": "patch-package"
  },
  "dependencies": {
    "@expo/react-native-action-sheet": "^3.14.0",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-community/datetimepicker": "6.2.0",
    "@react-native-community/masked-view": "^0.1.11",
    "@react-native-firebase/app": "15.4.0",
    "@react-navigation/bottom-tabs": "^6.4.0",
    "@react-navigation/material-bottom-tabs": "^6.2.4",
    "@react-navigation/material-top-tabs": "^6.3.0",
    "@react-navigation/native": "^6.0.13",
    "@react-navigation/native-stack": "^6.9.1",
    "@react-navigation/stack": "^6.3.2",
    "@reduxjs/toolkit": "^1.8.6",
    "axios": "^1.1.3",
    "country-codes-list": "^1.6.10",
    "deprecated-react-native-prop-types": "^4.0.0",
    "expo": "^48.0.4",
    "expo-application": "~4.2.2",
    "expo-build-properties": "~0.3.0",
    "expo-calendar": "~10.3.0",
    "expo-clipboard": "~3.1.0",
    "expo-constants": "~13.2.4",
    "expo-dev-client": "~1.3.1",
    "expo-device": "~4.3.0",
    "expo-haptics": "~11.3.0",
    "expo-image-picker": "~13.3.1",
    "expo-intent-launcher": "~10.3.1",
    "expo-linear-gradient": "~11.4.0",
    "expo-linking": "~3.2.4",
    "expo-localization": "~13.1.0",
    "expo-location": "~14.3.0",
    "expo-notifications": "~0.16.1",
    "expo-skeleton-loader": "^1.1.3",
    "expo-splash-screen": "~0.16.2",
    "expo-status-bar": "~1.4.2",
    "expo-updates": "~0.14.7",
    "formik": "^2.2.9",
    "i18next": "^22.5.0",
    "imagekit-javascript": "1.3.7",
    "lottie-react-native": "5.1.3",
    "moment": "^2.29.4",
    "moti": "^0.25.3",
    "patch-package": "^6.5.1",
    "react": "18.0.0",
    "react-i18next": "^11.18.6",
    "react-native": "0.69.6",
    "react-native-actions-sheet": "^0.8.8",
    "react-native-bouncy-checkbox": "^3.0.6",
    "react-native-calendars": "1.1248.0",
    "react-native-collapsible-tab-view": "^5.0.0-rc.13",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-google-places-autocomplete": "^2.4.1",
    "react-native-hyperlink": "^0.0.22",
    "react-native-map-clustering": "^3.4.2",
    "react-native-map-link": "^2.10.2",
    "react-native-maps": "0.31.1",
    "react-native-modal": "^13.0.1",
    "react-native-pager-view": "5.4.24",
    "react-native-paper": "4.9.2",
    "react-native-reanimated": "~2.9.1",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-section-list-get-item-layout": "^2.2.3",
    "react-native-share": "^8.1.0",
    "react-native-shared-element": "0.8.4",
    "react-native-svg": "12.3.0",
    "react-native-svg-transformer": "^1.0.0",
    "react-native-tab-view": "^3.3.0",
    "react-native-toast-message": "^2.1.5",
    "react-native-uuid": "^2.0.1",
    "react-native-vector-icons": "^9.2.0",
    "react-navigation-shared-element": "^3.1.3",
    "react-redux": "^8.0.4",
    "yup": "^0.32.11",
    "@shopify/react-native-skia": "0.1.141"
  },
  "devDependencies": {
    "@babel/core": "^7.19.3",
    "babel-plugin-transform-inline-environment-variables": "^0.4.4"
  },
  "private": true
}
PCPrzemoGUY commented 1 year ago

Yeah, the same issue is on our side. Any ideas on how to deal with it? BTW. all started when we try to add firebase. Strangely, SKIA used to work before that...

MarcHbb commented 1 year ago

I had this issue while having already firebase installed, never tried without firebase, but you might be right. I've seen similar issues on many forums

Episodex commented 1 year ago

I suspect that adding these lines to app.json could have broken it:

{
  "expo": {
    "plugins": [
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ]
  }
}
MarcHbb commented 1 year ago

Should I remove the these lines ?

[
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
Episodex commented 1 year ago

This will probably break Firebase. But here's an issue I just found that has some solutions: https://github.com/Shopify/react-native-skia/issues/652

MarcHbb commented 1 year ago

@Episodex I've already look through this issue. But it's not related to mange workflow with expo, all workaround or fixes are for bare workflow. There's only one related to eas and exo managed workflow, with a patch or somehow. Tried this solution but its not working :/

Episodex commented 1 year ago

We'll check this in a while also. The solution with custom plugin.

MarcHbb commented 1 year ago

I will double check the custom plugin solution too thanks :)

Episodex commented 1 year ago

It works with the plugin solution. We put the plugin code in /plugins/ folder in withSkia.js file.

Then in app.json:

"plugins": [
      "@react-native-firebase/app",
      ["./plugins/withSkia"],
      [
        "expo-build-properties",
        {
          "ios": {
            "useFrameworks": "static"
          }
        }
      ]
    ],
chrfalch commented 1 year ago

Glad to hear that @Episodex has had success with the plugin - seems like you're on a rather old version of RN Skia, we've made a lot of improvement (we hope!) regarding interoperability with Firebase etc. Closing this for now - please reopen if the problem still occurs.

MarcHbb commented 1 year ago

Still not working for me even with the plugin @Episodex can you share your package versions ?

package.json

"expo": "^48.0.19",
"react-native": "0.69.9",
"@shopify/react-native-skia": "0.1.141",
"@react-native-firebase/analytics": "~15.4.0", ========== > (also tried with 15.7.0)
"@react-native-firebase/app": "~15.4.0",  ========== >(also tried with 15.7.0)

app.config

"plugins": [
        "@react-native-firebase/app",
        "./withSkia", ========== > ( also tried with ["./withSkia"] )
        "./withReactNativeMaps",
        [
            "expo-build-properties",
            {
                "android": {
                    "compileSdkVersion": 31,
                    "targetSdkVersion": 31,
                    "buildToolsVersion": "31.0.0"
                },
                "ios": {
                    "deploymentTarget": "13.0",
                    "useFrameworks": "static"
                }
            }
        ],
    ],

Error :


❌  (node_modules/@shopify/react-native-skia/cpp/skia/include/core/SkStream.h:11:10)

   9 | #define SkStream_DEFINED
  10 | 
> 11 | #include "include/core/SkData.h"
     |          ^ 'include/core/SkData.h' file not found
  12 | #include "include/core/SkRefCnt.h"
  13 | #include "include/core/SkScalar.h"
  14 | #include "include/private/SkTo.h"
    Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the APPNAME editor. (in target 'APPNAME' from project 'APPNAME')
▸ ** BUILD FAILED **
▸ The following build commands failed:
▸   CompileC /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-skia.build/Objects-normal/x86_64/SkiaManager.o /Users/expo/workingdir/build/node_modules/@shopify/react-native-skia/ios/RNSkia-iOS/SkiaManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-skia' from project 'Pods')
▸ (1 failure)
2023-07-02 05:28:14.369 xcodebuild[4291:12039] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2023-07-02 05:28:14.369 xcodebuild[4291:12039] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
2023-07-02 05:28:14.407 xcodebuild[4291:12039] XType: failed to connect - Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process.}
2023-07-02 05:28:14.407 xcodebuild[4291:12039] Font server protocol version mismatch (expected:5 got:0), falling back to local fonts
2023-07-02 05:28:14.407 xcodebuild[4291:12039] XType: unable to make a connection to the font daemon!
2023-07-02 05:28:14.407 xcodebuild[4291:12039] XType: XTFontStaticRegistry is enabled as fontd is not available.
** BUILD FAILED **
The following build commands failed:
    CompileC /Users/expo/workingdir/build/ios/build/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-skia.build/Objects-normal/x86_64/SkiaManager.o /Users/expo/workingdir/build/node_modules/@shopify/react-native-skia/ios/RNSkia-iOS/SkiaManager.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-skia' from project 'Pods')
(1 failure)
Exit status: 65