bamlab / react-native-flipper-performance-monitor

An attempt to have a lighthouse for React Native. Flipper plugin to show a graph of the React Native performance monitor
MIT License
588 stars 17 forks source link

Expo EAS Build failing for production (iOS) #61

Closed erisvaldojunior closed 2 years ago

erisvaldojunior commented 2 years ago

After installing react-native-flipper-performance-plugin as a devDependency, all my EAS iOS Productions builds are failing.

Command: eas build -p ios --proflie production

Log:

Compiling react-native-flipper-performance-plugin Pods/react-native-flipper-performance-plugin » FlipperPerformancePlugin.m

❌  (node_modules/react-native-flipper-performance-plugin/ios/FlipperPerformancePlugin.h:3:9)

  1 | #import <Foundation/Foundation.h>
  2 | 
> 3 | #import <FlipperKit/FlipperPlugin.h>
    |         ^ 'FlipperKit/FlipperPlugin.h' file not found
  4 | #import <React/RCTBridge.h>
  5 | 
  6 | @interface FlipperPerformancePlugin : NSObject<RCTBridgeModule, FlipperPlugin>
▸ ** ARCHIVE FAILED **
▸ The following build commands failed:
▸   CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'sovran-react-native' from project 'Pods')
▸   CompileC /Users/expo/Library/Developer/Xcode/DerivedData/Curebase-hlhkbcpnqfhmkyadpnbibuogbjfb/Build/Intermediates.noindex/ArchiveIntermediates/Curebase/IntermediateBuildFilesPath/Pods.build/Release-iphoneos/react-native-flipper-performance-plugin.build/Objects-normal/arm64/FlipperPerformancePlugin.o /Users/expo/workingdir/build/node_modules/react-native-flipper-performance-plugin/ios/FlipperPerformancePlugin.m normal arm64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target 'react-native-flipper-performance-plugin' from project 'Pods')
▸ (2 failures)
20

I do have FLIPPER_DISABLE on my eas.json:

    "production": {
      "env": {
        "APP_ENVIRONMENT": "production",
        "FLIPPER_DISABLE": "1"
      }
    }

Any thoughts?

Almouro commented 2 years ago

Hi @erisvaldojunior, Indeed we don't honor FLIPPER_DISABLE and we don't really check if Flipper is installed or not

Could you try out this branch #62 ?

You can install it with yarn add 'https://gitpkg.now.sh/bamlab/react-native-flipper-performance-monitor/flipper-native?fix/ios-flipper-disable'

erisvaldojunior commented 2 years ago

Sure @Almouro .

After running eas build -p ios --profile production --non-interactive for this branch I got this:

    Error: Cannot find module './plugin/build'
    Require stack:
    - /Users/erisvaldojunior/Developer/mobile-app/node_modules/react-native-flipper-performance-plugin/app.plugin.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@expo/config-plugins/build/plugins/withPlugins.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@expo/config-plugins/build/index.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/build/project/ios/bundleIdentifier.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/build/credentials/ios/api/GraphqlClient.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/build/credentials/context.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/build/submit/context.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/build/build/runBuildAndSubmit.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/build/commands/build/index.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@oclif/core/lib/module-loader.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@oclif/core/lib/config/plugin.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@oclif/core/lib/config/config.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@oclif/core/lib/config/index.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@oclif/core/lib/command.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/node_modules/@oclif/core/lib/index.js
    - /Users/erisvaldojunior/.config/yarn/global/node_modules/eas-cli/bin/run
    Code: MODULE_NOT_FOUND
Almouro commented 2 years ago

My bad, I've messed this up, of course installing directly from Github doesn't have the transpiled build folder 🤦‍♂️

yarn add react-native-flipper-performance-plugin-rc should work, and hopefully fix your issue! (I published it from the branch)

erisvaldojunior commented 2 years ago

@Almouro tested RC package and it is working fine. Thank you!