I'm losing my mind on a problem since 1 entire week... I have a ReactNative project, that runs very well on Android Simulator, but not on Xcode.
- My code
Actually, I have in my package.json :
Package.json
...
"react": "15.4.2",
"react-native": "^0.40.0",
...
"react-native-onesignal": "^3.0.3",
...
I can run npm install
or npm update
without any error.
Furthermore, I have in my Podfile, for my iOS project, in the iOS folder:
Podfile
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MyApp' do
pod 'OneSignal'
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '3.0'
end
end
end
When I run pod install
, it's working well and create the .xcworkspace file. When I open it, I can see the first error:
So I have googled it, and found the react-native-onesignal repo on GitHub, with a recommendation from the developer about my problem: he says to correctly follow iOS installation steps.
I have done it, by adding in Header Search Path
this : $(SRCROOT)/../node_modules/react-native-onesignal/ios
in recursive
:
Now, OneSignal.h is found, but I get a new error telling me that the library is duplicated:
For information, here is my library, my files, and my build phases:
Library in General
Files in Xcode
Build Phases
- What I have tried
I have tried to:
- delete the main.m, since it seems to be duplicated,
- delete one copy of the library, in both library in General or Library in Build phases,
- delete manually one copy in the files system in Xcode,
- remove
$(inherited)
flag inOther Files Flag
in my target Build Settings: the build succeeded, but my app is not working anymore ... I tried to remove other flags, but no results.
No solutions and I'm getting mad.