After upgrading to RN 0.62, I'm not able to build the app due to Flipper error in AppDelegate.m
I'm not actually sure what exactly is happening - I'm able to 'jump to definition' to every flipper file. Pods seems to be installed properly (I'm using the same pods as defined inside RN Podfile for 0.62 + my native dependencies
System:
OS: macOS 10.15.3
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 1.60 GB / 32.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.5.0 - /var/folders/dd/xmqm6lfx7v9gjsdyxjq689l80000gn/T/yarn--1585258712841-0.029739773405819347/node
Yarn: 1.21.1 - /var/folders/dd/xmqm6lfx7v9gjsdyxjq689l80000gn/T/yarn--1585258712841-0.029739773405819347/yarn
npm: 6.13.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 27, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-29 | Google APIs Intel x86 Atom, android-Q | Android TV Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.6010548
Xcode: 11.4/11E146 - /usr/bin/xcodebuild
Languages:
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: ^0.62.0 => 0.62.0
npmGlobalPackages:
*react-native*: Not Found
Make sure you run pod repo update
in the ios dir
cd ios; pod repo update; cd ../; yarn; cd ios; pod install;
Also, if you're blocked and not concerned with flipper right now, in your Podfile
you can comment these lines out:
#post_install do |installer|
# flipper_post_install(installer)
#end
@crobinson42: That didn't work
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
I have the same problem. what I found is that you need to edit the project.pbxproj file and add this
Keep in mind that the structure of that file depends a lot on you project. so what I can tell you is that I searched for DEAD_CODE_STRIPPING = NO; and put the code there.
@felexx90 Adding the below will add the flag.
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
Do you see this problem when creating a new project? If this issue doesn't occur in a new project, I recommend you create an issue on the upgrade-support repo instead. Sharing your issues when upgrading on that repo will improve the likelihood that you will find others with the same problem and find fixes. It also helps others find you! 馃槃
This seems like the same issue as react-native-community/upgrade-support#11.
Great! Closing this one then.
Thanks all for your comments here. I know this issue is more active than the other one but we are trying to make that repo the source of truth for issues related to upgrading. If you could bring this convo to that other issue that would be fantastic. Thanks!
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
I added those and got some problems with swift symbols even tho I added the dummy.swift file and bridging header thing, until I added $(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)
to library search path
and changed Podfile line 71
target 'yallaLieferRNTests' do
inherit! :complete
# Pods for testing
end
which is in the changes log btw! to
https://react-native-community.github.io/upgrade-helper/?from=0.61.5&to=0.62.0
target 'yallaLieferRNTests' do
inherit! :search_paths
# Pods for testing
end
and it worked!
@RatebSeirawan thanks. This helped in my case.
Cheers @RatebSeirawan
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
This should be in the official guide
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
I tried to follow this guide: https://github.com/react-native-community/upgrade-helper/issues/191
No luck.
And then tried @jinshin1013 solution and it worked! Thanks a lot!
PS: I did not revert the changes from the guide that I linked.
Got it working. What's ETA on not requiring a dummy swift file?
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
馃憦馃憦
This should be added to the documentation.
So, can someone provide some steps combining Upgrade tool and what Flipper says that are actually working to migrate from 0.61.4-5 to 0.62.0-2?
After trying every solution an producing new errors finally I decided to create a new react native project and then copy the ios folder of newly created project and put it to my current project and also merge my old info.plist, podfile and some assets with new project. and hopefully all of errors gone. :)
@villanuevadani Sure, here's how I got it working just now after upgrading from 0.61.5 to 0.62.2 (in this order):
Missing this out also fixed my iOS crash on launch after a lot of headache
I.e. https://github.com/react-native-community/upgrade-support/issues/13
For an _easy_ upgrade experience of the Xcode project file, do the following...
@pvinis didn't turn out to be as _easy_ as it sounds 馃槃
It took me a while with multiple of the solutions above to fix it with RN 0.62.2 馃挭
However I noticed that upgrading to RN 0.63.0-rc.0 actually auto solves the issue, all the flipper deps were replaced by a single line 馃憤
https://react-native-community.github.io/upgrade-helper/?from=0.62.2&to=0.63.0-rc.0
Can't the upgrade-helper be updated to fix all these above issues? Been trying way too long and still fails builds.
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.This should be in the official guide
@jvink , I hope so (:. For now, I hope the above comment helps you. This is how I got it to build as well. Just get a new branch with a clean slate, follow this guide and it will work 馃挭
Also all of this is fixed in rn 0.63 and all RN pods were replaced with a single line acting as a blackbox 馃殌
@A-Tokyo So just the above, and not the changes in the manual updating guide?
Also, let's say I switch to 0.63 immediately and skip 0.62, would that solve these issues?
Anyways, thanks for your help.
@A-Tokyo, You should follow this guide https://reactnative.thenativebits.com/courses/upgrading-react-native/upgrade-to-react-native-0.62 and at the same time apply the steps in my comment above. (The tutorial I just sent will redirect to these steps as well)
If you switch to 0.63 immedietly it resolves these issues yes. However I had troubles with android with 0.63.0-rc0
You are welcome ( : Let me know if I can be of any more help
Hi!
I got the same problem in the update from the react-native version V0.61.5 to V0.62.2.
A lot of the fixes explained here worked for me, but something keep me bugging my mind, so I created a new empty project and run it, the clean project worked like a charm, but it didn't had any of this works around presented here.
This made me realise that my configuration must have something wrong, so I end up checking some fields and comparing to the newly created clean project.
My initial thought it was some bad import or path was wrong in my project, but it end up being a little bit more.
This are the stuff that I changed in my project to the same or almost the same values has the clean project:
Watch out some of this configurations where made in project level and other in target level and there's a chance that this may not fit your needs or that it isn't enough since this can change depending on the project it self.
Happy coding!! 馃槂 馃帀
Thanks @jinshin1013
If you are running a pure Objective C project, instead of creating a dummy.swift file to get rid of errors like Undefined symbol _swift_getFunctionReplacement
, follow these instructions.
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
Its work for me!!
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your 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
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.
This helped me. Only thing is that there is no mention how to add that dummy swift file (for us iOS noobs). So here are the instructions for that https://stackoverflow.com/questions/50096025/it-gives-errors-when-using-swift-static-library-with-objective-c-project/56187043#56187043
Most helpful comment
Alright, I got it to build with following this instruction on iOS.
Make sure add this in your Podfile:
After adding this if you do not have any Swift file in your project, you will see some nasty Swift compile error. Just add new
Dummy.swift
file to the project and click yes to when it asks you to add bridging or whatever.