Open palkerecsenyi opened 4 years ago
If anyone happens to have this (or a similar) issue, and you don't need Flipper support for your app, disabling Flipper solves the issue.
Comment out these lines from Podfile
:
add_flipper_pods!
post_install do |installer|
flipper_post_install(installer)
end
And from AppDelegate.m
:
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
static void InitializeFlipper(UIApplication *application) {
FlipperClient *client = [FlipperClient sharedClient];
SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults];
[client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]];
[client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]];
[client addPlugin:[FlipperKitReactPlugin new]];
[client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]];
[client start];
}
#endif
// ...
#if DEBUG
InitializeFlipper(application);
#endif
I know this fix isn't really a fix at all, but if you want the other new features/bug fixes in 0.62 and are okay without Flipper, you can disable it altogether on iOS fairly easily.
I was getting that error, and this fixed it for me: https://github.com/react-native-community/upgrade-support/issues/30#issuecomment-608495255
I added a File.swift in my projects, and it was ok. But if I removed the file again, it crashed again. So, in xCode, I went to BuildSettings -> Linking -> runpath search path , and manually changed each build line to:
/usr/lib/swift $(inherited) And now it builds and starts fine, without the .swift file
Took me hours to figure this out but I had to manually add Flipper to my Podfile, since I could not run react-native update
on my project. I noticed I wasn't getting all these extra Flipper pod files compared to a new project.
https://fbflipper.com/docs/getting-started/react-native-ios
platform :ios, '9.0'
def flipper_pods()
flipperkit_version = '0.49.0'
pod 'FlipperKit', '~>' + flipperkit_version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitLayoutPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
pod 'FlipperKit/SKIOSNetworkPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitUserDefaultsPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
pod 'FlipperKit/FlipperKitReactPlugin', '~>' + flipperkit_version, :configuration => 'Debug'
end
# Post Install processing for Flipper
def flipper_post_install(installer)
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
target 'your-app-name' do
...
# Replace the existing yoga import with the following (adding modular_headers):
pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true
...
use_native_modules!
# For enabling Flipper.
# Note that if you use_framework!, flipper will not work.
# Disable these lines if you are doing use_framework!
flipper_pods()
post_install do |installer|
flipper_post_install(installer)
end
end
Add @executable_path/Frameworks
at Runpath Search Paths
worked for me.
I had the same issue here, I tried tons of solutions in Stack Overflow (such as the one linked above this comment ☝🏽 ) but the only thing that managed to remove this error was disabling flipper 😞
Had the same issue and only adding /usr/lib/swift
to Runpath Search Paths helped.
Environment
Upgrading version
0.61.5 -> 0.62.0 using https://react-native-community.github.io/upgrade-helper/?from=0.61.5&to=0.62.0 and #13. I have also set
Always Embed Swift Standard Libraries
toYES
.Description
The app builds successfully but crashes immediately (only on iOS) when opening. The following error is given:
Here are some of my project files:
AppDelegate.m
AppDelegate.h
PalChat-Bridging-Header.h
Dummy.swift
Podfile
package.json
My Swift build settings:
![image](https://user-images.githubusercontent.com/22198767/78149010-6a0feb80-742d-11ea-8a0e-14555c66c347.png)
I have tried:
DerivedData
but nothing has worked so far.
Reproducible demo
I was unable to recreate this error in a fresh React Native project, which leads me to believe that I did something wrong during the upgrade. The project worked perfectly on RN 0.61.5.
Thanks in advance, and please let me know if there are any other files/logs I need to provide.