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

Use of undeclared identifier FlipperClient #24

Open
rahulkasana opened this issue Mar 31, 2020 · 23 comments
Open

Use of undeclared identifier FlipperClient #24

rahulkasana opened this issue Mar 31, 2020 · 23 comments

Comments

@rahulkasana
Copy link

Environment

System:
OS: macOS 10.15.3
CPU: (4) x64 Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
Memory: 454.10 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.12.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
Android SDK:
API Levels: 23, 25, 27, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: Not Found
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
Languages:
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.0 => 0.62.0
npmGlobalPackages:
react-native: Not Found

Upgrading version

I'm upgrading from 0.59.8 to 0.62 manually. (Android works fine but IOS does not)

Description

I manually upgraded using this
https://react-native-community.github.io/upgrade-helper/?from=0.59.8&to=0.62.0
and changed xcodeproject file using this step by step.
#13
But after finishing every steps and when i try to build i get this error.

Screenshot 2020-03-31 at 6 25 24 PM

And even if i comment this another error appears.
""_YGNodeHasMeasureFunc", referenced from:
-[YGLayout markDirty] in libYogaKit.a(YGLayout.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
"

@lorenc-tomasz
Copy link

Go to Build Settings
Find Preprocessor Macros
To Debug add new value:
FB_SONARKIT_ENABLED=1

@rahulkasana
Copy link
Author

@lorenc-tomasz I tried this. But I'm getting this error now.

Screenshot 2020-03-31 at 7 27 16 PM

@lorenc-tomasz
Copy link

Remove this:

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

Add dummy / empty swift file. Will create bridge file if not exist. Leave the file within the project.

@ovy9086
Copy link

ovy9086 commented Mar 31, 2020

having the same issue 🤔

@rahulkasana
Copy link
Author

Remove this:

"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)"

Add dummy / empty swift file. Will create bridge file if not exist. Leave the file within the project.

@lorenc-tomasz I removed those 2 LIBRARY_SEARCH_PATHS and tried the build after adding the dummy swift file and running clean. Also this time it didn't asked for create bridging header for new file. And still got the same error.

@lorenc-tomasz
Copy link

I had the same issue. The step above resolved my issue. Sorry that I couldn't help you :(

@lorenc-tomasz
Copy link

Last idea.

Add this to Podfile

# Post Install processing for Flipper
def flipper_post_install(installer)
  installer.pods_project.targets.each do |target|
    if target.name == 'YogaKit'
      target.build_configurations.each do |config|
        config.build_settings['SWIFT_VERSION'] = '4.1'
      end
    end
  end
  file_name = Dir.glob("*.xcodeproj")[0]
  app_project = Xcodeproj::Project.open(file_name)
  app_project.native_targets.each do |target|
    target.build_configurations.each do |config|
      cflags = config.build_settings['OTHER_CFLAGS'] || '$(inherited) '
      unless cflags.include? '-DFB_SONARKIT_ENABLED=1'
        puts 'Adding -DFB_SONARKIT_ENABLED=1 in OTHER_CFLAGS...'
        cflags << '-DFB_SONARKIT_ENABLED=1'
      end
      config.build_settings['OTHER_CFLAGS'] = cflags
    end
    app_project.save
  end
  installer.pods_project.save
end

@rahulkasana
Copy link
Author

@lorenc-tomasz I really appreciate your help!!! THANKS A TON. I wanted to ask is there any way i can again get that dialog to create bridging header for new file. Tho i remember clicking it during following the link step by step.

@rahulkasana
Copy link
Author

Screenshot 2020-03-31 at 9 31 10 PM

@lucasbento lucasbento added 0.62.0 and removed 0.59.8 labels Mar 31, 2020
@lorenc-tomasz
Copy link

As far I know it's not possible. But you can create AppName-Bridging-Header.h file. Then go to Build Settings and under Swift Compiler - General find option Objective-C bridging Header Add there AppName-Bridging-Header.h as a value.

@mikehardy
Copy link

This bit me in my upgrade as well.

I needed FB_SONARKIT_ENABLED=1, I needed the "$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)", "$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)" library search paths, and I needed to maintain the dummy Swift file (not delete it) as well as enable dead code stripping per #25 - kind of a mess IMHO but I think it's working now.

Xcode is so difficult to deal with.

@lucasbento
Copy link
Member

The guide at https://fbflipper.com/docs/troubleshooting.html#build-errors-in-react-native may help you out, it removes the need of a dummy swift file.

@tomasswood
Copy link

Following the instructions here (without deleting the bridging file at the end): react-native-community/upgrade-helper#191

And adding FB_SONARKIT_ENABLED=1 resolved the issue for me.

@mikehardy
Copy link

I'll have a look at the fbflipper.com guide - but a separate thought that's personal to my project is that when I saw that flipper was optional for 61 I skipped all of it. So it might be that I had a pent up set of changes necessary and it's my fault for not looking at the 60->61 changes more closely. I mention it because that might be the case for others as well

Final note, flipper pulls in the OpenSSL-Universal pod which causes bitcode-enabled debug builds to fail on real devices - related facebook/flipper#485 (and how I became aware: invertase/react-native-firebase#3384) - there are workarounds though in case others need them, specifically make sure bitcode is disabled for debug builds and then if you want it enabled on release builds I think you need dead code stripping too (I had a successful testflight build with bitcode enabled and dead code stripping on, anyway).

Hope this helps!

@mansdahlstrom1
Copy link

mansdahlstrom1 commented Apr 3, 2020

Go to Build Settings
Find Preprocessor Macros
To Debug add new value:
FB_SONARKIT_ENABLED=1

This worked for me! Thanks a bunch @lorenc-tomasz

EDIT: Did not solve it. stil back, and after create a new react native project for debugging and comparing the settings i found that a clean project does not use this? How come clean projects does not use it?

@jamesawer3
Copy link

I followed everything said in this link react-native-community/upgrade-helper#191 and added below lines

Go to Build Settings
Find Preprocessor Macros
To Debug add new value:
FB_SONARKIT_ENABLED=1

But, Still I'm getting the error

@luisgrases
Copy link

I fixed it by doing rm -rf /Users/{user}/Library/Developer/Xcode/DerivedData/{project_id}/Build/Products/Debug-iphonesimulator and building again

@mikehardy
Copy link

@luisgrases then you'll love https://github.com/pmadruga/react-native-clean-project/ - don't try CI without it :-)

@andrekovac
Copy link

Go to Build Settings
Find Preprocessor Macros
To Debug add new value:
FB_SONARKIT_ENABLED=1

This should be added to https://react-native-community.github.io/upgrade-helper/

@jeremy-jm
Copy link

I tried all the answer, but nothing is available...

@zhuiye
Copy link

zhuiye commented Sep 24, 2020

I fixed it by doing rm -rf /Users/{user}/Library/Developer/Xcode/DerivedData/{project_id}/Build/Products/Debug-iphonesimulator and building again
Thanks, solved my problem

@pwaweru
Copy link

pwaweru commented Nov 21, 2020

Go to Build Settings
Find Preprocessor Macros
To Debug add new value:
FB_SONARKIT_ENABLED=1

This worked like a charm, many thanks @lorenc-tomasz

@hahtml
Copy link

hahtml commented Dec 11, 2020

Go to Build Settings
Find Preprocessor Macros
To Debug add new value:
FB_SONARKIT_ENABLED=1

It works for me

saru2020 added a commit to saru2020/Musicly that referenced this issue Jan 29, 2023
details:
- [x] Issue: Warning: “rctbridge required dispatch_sync to load rctdevsettings. this may lead to deadlocks” ; Solution: [refer: https://amanhimself.dev/blog/rctbridge-required-dispatch-sync-to-load-warning/]
- [x] Xcodeproj upgrade in React Native 0.60.0 [refer: react-native-community/upgrade-support#14] —> removed the linked libraries since these dependencies were now being managed by cocoa pods itself
- [x] Use of undeclared identifier FlipperClient [refer: react-native-community/upgrade-support#24 (comment)]
- [x] Issue: “atomic_notify_one<unsigned%20long>” ; Solution: [refer: https://stackoverflow.com/a/70874670/1374730]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests