Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@nrwl/react-native run-ios failed on second run. Newly generated app #15620

Closed
Singloo opened this issue Mar 12, 2023 · 16 comments
Closed

@nrwl/react-native run-ios failed on second run. Newly generated app #15620

Singloo opened this issue Mar 12, 2023 · 16 comments
Labels
outdated scope: react-native Issues relating to React Native type: bug

Comments

@Singloo
Copy link
Contributor

Singloo commented Mar 12, 2023

Current Behavior

npx nx run-ios mobile failed on the second run

Expected Behavior

Should work properly

GitHub Repo

https://github.com/Singloo/nx-react-native-test

Steps to Reproduce

  1. npx create-nx-workspace test-rn
    --preset=react-native
    --appName=mobile

  2. npx nx run-ios mobile

  3. npx nx run-ios mobile

Nx Report

Node : 16.13.1
   OS   : darwin x64
   npm  : 8.1.2
   
   nx                      : 15.8.6
   @nrwl/js                : 15.8.6
   @nrwl/jest              : 15.8.6
   @nrwl/linter            : 15.8.6
   @nrwl/workspace         : 15.8.6
   @nrwl/cli               : 15.8.6
   @nrwl/detox             : 15.8.6
   @nrwl/devkit            : 15.8.6
   @nrwl/eslint-plugin-nx  : 15.8.6
   @nrwl/react             : 15.8.6
   @nrwl/react-native      : 15.8.6
   @nrwl/tao               : 15.8.6
   typescript              : 4.9.5

Failure Logs

get full logs

In file included from /Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/RCT-Folly/folly/executors/GlobalExecutor.cpp:26:
/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Private/RCT-Folly/folly/executors/CPUThreadPoolExecutor.h:177:25: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
  BlockingQueue<CPUTask>* getTaskQueue();
                        ^
/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Private/RCT-Folly/folly/executors/CPUThreadPoolExecutor.h:177:25: note: insert '_Nullable' if the pointer may be null
  BlockingQueue<CPUTask>* getTaskQueue();
                        ^
                          _Nullable
/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Private/RCT-Folly/folly/executors/CPUThreadPoolExecutor.h:177:25: note: insert '_Nonnull' if the pointer should never be null
  BlockingQueue<CPUTask>* getTaskQueue();
                        ^
                          _Nonnull
1 warning generated.
CompileC /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/Objects-normal/x86_64/RCTNativeAnimatedModule.o /Users/origami/Desktop/temp_projects/test-rn/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-RCTAnimation' from project 'Pods')
    cd /Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -target x86_64-apple-ios12.4-simulator -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -std\=c++1z -stdlib\=libc++ -fobjc-arc -fmodules -fmodules-cache-path\=/Users/origami/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/origami/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -fno-common -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -DPOD_CONFIGURATION_DEBUG\=1 -DDEBUG\=1 -DCOCOAPODS\=1 -DOBJC_OLD_DISPATCH_PROTOTYPES\=0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -g -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -fobjc-abi-version\=2 -fobjc-legacy-dispatch -index-store-path /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Index.noindex/DataStore -iquote /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/React-RCTAnimation-generated-files.hmap -I/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/React-RCTAnimation-own-target-headers.hmap -I/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/React-RCTAnimation-all-non-framework-target-headers.hmap -ivfsoverlay /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/all-product-headers.yaml -iquote /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/React-RCTAnimation-project-headers.hmap -I/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Products/Debug-iphonesimulator/React-RCTAnimation/include -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Private -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Private/React-RCTAnimation -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/DoubleConversion -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/FBLazyVector -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/RCT-Folly -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/RCTRequired -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/RCTTypeSafety -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-Codegen -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-Core -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-RCTAnimation -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-callinvoker -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-cxxreact -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-hermes -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-jsi -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-jsiexecutor -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-jsinspector -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-logger -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-perflogger -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-runtimeexecutor -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/ReactCommon -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/Yoga -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/fmt -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/glog -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/hermes-engine -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/libevent -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/RCT-Folly -I/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React-Codegen/react/renderer/components -I/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Products/Debug-iphonesimulator/React-Codegen/React_Codegen.framework/Headers -I/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/DerivedSources-normal/x86_64 -I/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/DerivedSources/x86_64 -I/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/DerivedSources -F/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Products/Debug-iphonesimulator/React-RCTAnimation -F/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/hermes-engine/destroot/Library/Frameworks/universal -F/Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/hermes-engine/Pre-built -fmodule-map-file\=/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/RCTTypeSafety/RCTTypeSafety.modulemap -fmodule-map-file\=/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React/React-Core.modulemap -fmodule-map-file\=/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/ReactCommon/ReactCommon.modulemap -fmodule-map-file\=/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/React_Codegen/React-Codegen.modulemap -fmodule-map-file\=/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/folly/RCT-Folly.modulemap -fmodule-map-file\=/Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Headers/Public/yoga/Yoga.modulemap -DFOLLY_NO_CONFIG -DFOLLY_MOBILE\=1 -DFOLLY_USE_LIBCPP\=1 -Wno-comma -Wno-shorten-64-to-32 -Wno-nullability-completeness -include /Users/origami/Desktop/temp_projects/test-rn/apps/mobile/ios/Pods/Target\ Support\ Files/React-RCTAnimation/React-RCTAnimation-prefix.pch -MMD -MT dependencies -MF /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/Objects-normal/x86_64/RCTNativeAnimatedModule.d --serialize-diagnostics /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/Objects-normal/x86_64/RCTNativeAnimatedModule.dia -c /Users/origami/Desktop/temp_projects/test-rn/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm -o /Users/origami/Library/Developer/Xcode/DerivedData/Mobile-cgxbwkilewjtzbcjpnvhzvgelarj/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/Objects-normal/x86_64/RCTNativeAnimatedModule.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/React-RCTAnimation.build/Objects-normal/x86_64/RCTNativeAnimatedModule.o
/Users/origami/Desktop/temp_projects/test-rn/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:234:22: error: use of undeclared identifier 'JS'
                  : (JS::NativeAnimatedModule::EventMapping &)eventMapping)
                     ^
/Users/origami/Desktop/temp_projects/test-rn/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:234:22: error: expected a type
/Users/origami/Desktop/temp_projects/test-rn/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:237:76: error: property 'nativeEventPath' not found on object of type '__strong id'
  eventMappingDict[@"nativeEventPath"] = RCTConvertVecToArray(eventMapping.nativeEventPath());
                                                                           ^
/Users/origami/Desktop/temp_projects/test-rn/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:239:20: error: property 'animatedValueTag' not found on object of type '__strong id'
  if (eventMapping.animatedValueTag()) {
                   ^
/Users/origami/Desktop/temp_projects/test-rn/node_modules/react-native/Libraries/NativeAnimation/RCTNativeAnimatedModule.mm:240:61: error: property 'animatedValueTag' not found on object of type '__strong id'
    eventMappingDict[@"animatedValueTag"] = @(*eventMapping.animatedValueTag());
                                                            ^
5 errors generated.

Additional Information

react-native info

System:
    OS: macOS 13.0
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 174.75 MB / 16.00 GB
    Shell: 3.4.0 - /usr/local/bin/fish
  Binaries:
    Node: 16.13.1 - ~/.asdf/installs/nodejs/16.13.1/bin/node
    Yarn: 1.22.17 - ~/.asdf/installs/nodejs/16.13.1/.npm/bin/yarn
    npm: 8.1.2 - ~/.asdf/plugins/nodejs/shims/npm
    Watchman: 2023.02.13.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.1 AI-221.6008.13.2211.9514443
    Xcode: 14.2/14C18 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.18 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: 10.1.3 => 10.1.3 
    react: 18.2.0 => 18.2.0 
    react-native: 0.71.2 => 0.71.2 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found
@Singloo
Copy link
Contributor Author

Singloo commented Mar 12, 2023

Is it related to NX cache mechanisms?

Contents under ios/build/generated/ios are only generated at the first run. Subsequent runs will clean this directory but only generate FBReactNativeSpec

First run

Screenshot 2023-03-12 at 19 21 13

Second run

Screenshot 2023-03-12 at 18 48 22

@Singloo
Copy link
Contributor Author

Singloo commented Mar 12, 2023

Tried the flag --skip-nx-cache. Not working

But if I switch dir between workspace root dir and app dir to run the command it works.

@Singloo
Copy link
Contributor Author

Singloo commented Mar 12, 2023

Figured out the root cause. The error was thrown from this function

Nx script seems that only load.xcode.env once?

@curthipster
Copy link
Contributor

Contents under ios/build/generated/ios are only generated at the first run. Subsequent runs will clean this directory but only generate FBReactNativeSpec

@Singloo I've been dealing with a similar incremental build error for a week or so now, and I'm observing the same thing with that directory.

I don't see the connection between that and your last comment:

Figured out the root cause. The error was thrown from this function

Nx script seems that only load.xcode.env once?

@Singloo
Copy link
Contributor Author

Singloo commented Mar 13, 2023

Contents under ios/build/generated/ios are only generated at the first run. Subsequent runs will clean this directory but only generate FBReactNativeSpec

@Singloo I've been dealing with a similar incremental build error for a week or so now, and I'm observing the same thing with that directory.

I don't see the connection between that and your last comment:

Figured out the root cause. The error was thrown from this function
Nx script seems that only load.xcode.env once?

@curthipster RN codegen is using NODE_BINARY to detect node. Which is set from .xcode.env. But .xcode.env is not sourced every time. Edit this file can make sure NODE_BINARY is set correctly

Try to edit .xcode.env to see if it solves your problem

@curthipster
Copy link
Contributor

Try to edit .xcode.env to see if it solves your problem

@Singloo what did you change in .xcode.env? I use volta to manage my node versions and from what I can tell, it's picking up the right node version.

I am seeing the artifacts in ios/build/generated/ios get blown away and never recreated in the rebuild, which as you point out above is likely causing the compilation error. I haven't yet figured out what's deleting those files.

@AgentEnder AgentEnder added the scope: react-native Issues relating to React Native label Mar 13, 2023
@Singloo
Copy link
Contributor Author

Singloo commented Mar 14, 2023

Try to edit .xcode.env to see if it solves your problem

@Singloo what did you change in .xcode.env? I use volta to manage my node versions and from what I can tell, it's picking up the right node version.

I am seeing the artifacts in ios/build/generated/ios get blown away and never recreated in the rebuild, which as you point out above is likely causing the compilation error. I haven't yet figured out what's deleting those files.

@curthipster Add some comments or space to .xcode.env. I use asdf for node version management

@curthipster
Copy link
Contributor

@Singloo Thank you. So the key is that that file needs to be touched, and I accomplished the same with touch .xcode.env.

Do you understand why this gets build/generate/ios/* to regenerate?

@curthipster
Copy link
Contributor

@Singloo For now, I edited my mobile project.json as follows to make run-ios work:

    "patch-ios-incremental-build": {
      "executor": "nx:run-commands",
      "options": {
        "command": "touch apps/mobile/ios/.xcode.env"
      }
    },
    "run-ios": {
      "dependsOn": ["patch-ios-incremental-build"],
      "executor": "@nrwl/react-native:run-ios",
      "options": {
        "scheme": "Dev (Jam)"
      }
    },

@Singloo
Copy link
Contributor Author

Singloo commented Mar 14, 2023

@Singloo Thank you. So the key is that that file needs to be touched, and I accomplished the same with touch .xcode.env.

Do you understand why this gets build/generate/ios/* to regenerate?

@curthipster Some of those node version management tools don't have NODE_BINARY, this file sets it

# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.

# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)
export ENTRY_FILE="${PROJECT_DIR}/../src/main.tsx"

@xiongemi
Copy link
Collaborator

i tried locally. i think i might know why. currently run-ios is trying to do pod install every time, by running the command with --install=false seems to work for the 2nd run. i would push up a proper fix. for now, change the run-ios target in project.json:

 "run-ios": {
      "executor": "@nrwl/react-native:run-ios",
      "options": {
        "install": false
      }
    }

@xiongemi
Copy link
Collaborator

fixed in pr #15704

@xiongemi
Copy link
Collaborator

i figure out another workaround.

  1. delete build folder under ios folder at apps//ios/build
  2. pass in buildFolder for run-ios like run-ios --buildFolder=./build --install=false <your app>

this should clear the ios cache and rebuild.

@WarrenBuffering
Copy link

Not sure this is really closed. Setting the install default to false doesn't really fix anything and you'll still have the same issue if install is set to true. Regenerating xcode.env anytime Pod dependencies change, similar to @curthipster's workaround seems like the more appropriate solution as far as I can understand, but I could be missing something.

@Singloo For now, I edited my mobile project.json as follows to make run-ios work:

    "patch-ios-incremental-build": {
      "executor": "nx:run-commands",
      "options": {
        "command": "touch apps/mobile/ios/.xcode.env"
      }
    },
    "run-ios": {
      "dependsOn": ["patch-ios-incremental-build"],
      "executor": "@nrwl/react-native:run-ios",
      "options": {
        "scheme": "Dev (Jam)"
      }
    },

@michaelwijnands
Copy link

I got the following errors.

@interface RCTNetworking () <NativeNetworkingIOSSpec>
                             ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:699:22: error: use of undeclared identifier 'JS'
                  : (JS::NativeNetworkingIOS::SpecSendRequestQuery &)query callback
                     ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:699:22: error: expected a type
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:747:30: error: no member named 'react' in namespace 'facebook'
- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
                   ~~~~~~~~~~^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:748:22: error: no member named 'react' in namespace 'facebook'
    (const facebook::react::ObjCTurboModule::InitParams &)params
           ~~~~~~~~~~^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:703:23: error: property 'method' not found on object of type '__strong id'
    @"method" : query.method(),
                      ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:704:20: error: property 'url' not found on object of type '__strong id'
    @"url" : query.url(),
                   ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:705:21: error: property 'data' not found on object of type '__strong id'
    @"data" : query.data(),
                    ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:706:24: error: property 'headers' not found on object of type '__strong id'
    @"headers" : query.headers(),
                       ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:707:29: error: property 'responseType' not found on object of type '__strong id'
    @"responseType" : query.responseType(),
                            ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:708:37: error: property 'incrementalUpdates' not found on object of type '__strong id'
    @"incrementalUpdates" : @(query.incrementalUpdates()),
                                    ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:709:26: error: property 'timeout' not found on object of type '__strong id'
    @"timeout" : @(query.timeout()),
                         ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:710:34: error: property 'withCredentials' not found on object of type '__strong id'
    @"withCredentials" : @(query.withCredentials()),
                                 ^
/Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm:750:37: error: no member named 'react' in namespace 'facebook'
  return std::make_shared<facebook::react::NativeNetworkingIOSSpecJSI>(params);
                          ~~~~~~~~~~^
14 errors generated.


2023-04-14 15:00:44.282 xcodebuild[49956:239685] DVTCoreDeviceEnabledState: DVTCoreDeviceEnabledState_Disabled set via user default (DVTEnableCoreDevice=disabled)
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:iOS Simulator, id:D382E7C8-6D7D-493E-B133-867410FBE741, OS:16.4, name:iPhone 14 }
{ platform:iOS Simulator, id:D382E7C8-6D7D-493E-B133-867410FBE741, OS:16.4, name:iPhone 14 }
** BUILD FAILED **


The following build commands failed:
        CompileC /Users/michaelwijnands/Library/Developer/Xcode/DerivedData/HnApp-gxixqhzwzsmicnaotbhpyyruogsy/Build/Intermediates.noindex/Pods.build/DebugPRV-iphonesimulator/React-RCTNetwork.build/Objects-normal/arm64/RCTNetworking.o /Users/michaelwijnands/Projects/app-frontend/node_modules/react-native/Libraries/Network/RCTNetworking.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-RCTNetwork' from project 'Pods')
(1 failure)
]

 >  NX   1

The above solution of adding patch-ios-incremental-build to touch .xcode.env fixed this problem when rerunning the app without having to clean all pods 👍 🚀 .

@github-actions
Copy link

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated scope: react-native Issues relating to React Native type: bug
Projects
None yet
Development

No branches or pull requests

6 participants