React-native-splash-screen: Use of undeclared identifier 'RNSplashScreen'

Created on 9 Jun 2020  路  8Comments  路  Source: crazycodeboy/react-native-splash-screen

System:
OS: macOS 10.15.3
CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
Memory: 23.23 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.16.3 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 29
Build Tools: 28.0.3, 29.0.3
System Images: android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6392135
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_251 - /usr/bin/javac
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.2 => 0.62.2
npmGlobalPackages:
react-native: Not Found

Problem:
Xcode will give me a error(Use of undeclared identifier 'RNSplashScreen') when i click product -> archive.but it is ok when i run the app in ios simulators

鎴睆2020-06-09涓嬪崍6 39 18
鎴睆2020-06-09涓嬪崍6 38 58

Most helpful comment

I had solve the problem,it is my carelessness.I import 'RNSplashScreen.h' after '#if DEBUG',so it is ok on ios simulators,but error in packaging ipa

All 8 comments

I had solve the problem,it is my carelessness.I import 'RNSplashScreen.h' after '#if DEBUG',so it is ok on ios simulators,but error in packaging ipa

import
#import "RNSplashScreen.h"
before #if DEBUG

I had solve the problem,it is my carelessness.I import 'RNSplashScreen.h' after '#if DEBUG',so it is ok on ios simulators,but error in packaging ipa

me too, how do you solve it, why close the issue?
I was getting an error when release the apps on ios. Any solution please?

I had solve the problem,it is my carelessness.I import 'RNSplashScreen.h' after '#if DEBUG',so it is ok on ios simulators,but error in packaging ipa

@imamabdulazis this is how he solved it.

Could any of you guys please clearly tell me how to solve this ?

I had solve the problem,it is my carelessness.I import 'RNSplashScreen.h' after '#if DEBUG',so it is ok on ios simulators,but error in packaging ipa

This answer is doesn't make sense to me

@akiladevinda I have just had this issue and the comment above didn't initially make sense to me either.

In my case, the line
#import <RNSplashScreen.h>

was included in this "ifdef" block related to Flutter/SonarKit

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
#import <RNSplashScreen.h>

whereas it should have been placed before that:

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <RNSplashScreen.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
#endif

Hope this helps.

@akiladevinda I have just had this issue and the comment above didn't initially make sense to me either.

In my case, the line
#import <RNSplashScreen.h>

was included in this "ifdef" block related to Flutter/SonarKit

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
#import <RNSplashScreen.h>

whereas it should have been placed before that:

#import "AppDelegate.h"

#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <RNSplashScreen.h>

#ifdef FB_SONARKIT_ENABLED
#import <FlipperKit/FlipperClient.h>
#import <FlipperKitLayoutPlugin/FlipperKitLayoutPlugin.h>
#import <FlipperKitUserDefaultsPlugin/FKUserDefaultsPlugin.h>
#import <FlipperKitNetworkPlugin/FlipperKitNetworkPlugin.h>
#import <SKIOSNetworkPlugin/SKIOSNetworkAdapter.h>
#import <FlipperKitReactPlugin/FlipperKitReactPlugin.h>
#endif

Hope this helps.

This worked. Thanks a lot.

@declan-betmate 's solution worked for me too. Only thing is I had to restart xcode and clean project after changing the appdelegate import of RNSplashScreen and then generate the build again.

Was this page helpful?
0 / 5 - 0 ratings