upgrade-support
upgrade-support copied to clipboard
Use of undeclared identifier FlipperClient
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. https://github.com/react-native-community/upgrade-support/issues/13 But after finishing every steps and when i try to build i get this error.
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) "
Go to Build Settings
Find Preprocessor Macros
To Debug
add new value:
FB_SONARKIT_ENABLED=1
@lorenc-tomasz I tried this. But I'm getting this error now.
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.
having the same issue 🤔
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.
I had the same issue. The step above resolved my issue. Sorry that I couldn't help you :(
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
@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.
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.
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.
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.
Following the instructions here (without deleting the bridging file at the end): https://github.com/react-native-community/upgrade-helper/issues/191
And adding FB_SONARKIT_ENABLED=1
resolved the issue for me.
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 https://github.com/facebook/flipper/issues/485 (and how I became aware: https://github.com/invertase/react-native-firebase/issues/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!
Go to
Build Settings
FindPreprocessor Macros
ToDebug
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?
I followed everything said in this link https://github.com/react-native-community/upgrade-helper/issues/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
I fixed it by doing rm -rf /Users/{user}/Library/Developer/Xcode/DerivedData/{project_id}/Build/Products/Debug-iphonesimulator
and building again
@luisgrases then you'll love https://github.com/pmadruga/react-native-clean-project/ - don't try CI without it :-)
Go to
Build Settings
FindPreprocessor Macros
ToDebug
add new value:FB_SONARKIT_ENABLED=1
This should be added to https://react-native-community.github.io/upgrade-helper/
I tried all the answer, but nothing is available...
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
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
Go to Build Settings Find Preprocessor Macros To Debug add new value: FB_SONARKIT_ENABLED=1
It works for me