Fastlane + ReactNative 0.40 does not compile - ios

Since updating to React native 0.40 that now supported namespaces, my project will not compile.
So what was before:
#import "RCTEventEmitter.h"
is now:
#import <React/RCTEventEmitter.h>
How can I define this for Fastlane to compile?
Error:
'React/RCTEventEmitter.h' file not found
#import <React/RCTEventEmitter.h>
^

Related

How to import a Pod from a development pod?

I'm creating a react-native module I would like for this custom module to import another pod, specifically AFNetworking.
How do I go about this?
What I've done:
Adding pod 'AFNetworking', '~> 4.0' to my project's Podfile
Added s.dependency "AFNetworking" in my custom module's podspec
import "AFNetworking.h" in MyModule.mm
I get the error Expected unqualified-id
I've tried all variations of
#import “../../../Pods/AFNetworking/AFNetworking.h”
#import "AFNetworking.h"
#import "AFNetworking/AFNetworking.h"
#import <AFNetworking.h>
#import <AFNetworking/AFNetworking.h>
None of which seem to work
This does the trick
#import <AFNetworking/AFNetworking.h>
See What is the difference between #include <filename> and #include "filename"?

react native splash screen get 'React/RCTBridgeModule.h' file not found

I started a new react native application using :
react-native init myApplication
I started with splash screen so i used this library react native spalsh screen
I linked the library to generate native code using this command :
react-native link react-native-splash-screen
And i added files using Xcode like this :
In XCode, in the project navigator, right click Libraries ➜ Add Files to [your project's name]
Go to node_modules ➜ react-native-splash-screen and add SplashScreen.xcodeproj
In XCode, in the project navigator, select your project. Add libSplashScreen.a to your project's Build Phases ➜ Link Binary With Libraries
To fix 'RNSplashScreen.h' file not found, you have to select your project → Build Settings → Search Paths → Header Search Paths to add: $(SRCROOT)/../node_modules/react-native-splash-screen/ios
I build the app using Xcode in a real Iphone and i get this error in RNSplashScreen.h :
/**
* SplashScreen
* 启动屏
* from:http://www.devio.org
* Author:CrazyCodeBoy
* GitHub:https://github.com/crazycodeboy
* Email:crazycodeboy#gmail.com
*/
#import <React/RCTBridgeModule.h> // <------'React/RCTBridgeModule.h' file not found
#import <UIKit/UIKit.h>
#interface RNSplashScreen : NSObject<RCTBridgeModule>
+ (void)showSplash:(NSString*)splashScreen inRootView:(UIView*)rootView;
+ (void)show;
+ (void)hide;
#end
'React/RCTBridgeModule.h' file not found
the Podfile :
pod 'React', :path => '../node_modules/react-native/'
pod 'React-Core', :path => '../node_modules/react-native/React'
...... # other libaries
pod 'react-native-splash-screen', :path => '../node_modules/react-
native-splash-screen'
AppDelegate.m :
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import "RNSplashScreen.h"
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
.... <------- other code
[RNSplashScreen show];
return YES;
}
Instead of
#import <React/RCTBridgeModule.h>
use
#import "RCTBridgeModule.h"
Hope this helps you. Feel free for doubts.

Build IOS in flutter it's showing GeneratedPluginRegistrant.m Plugin headers not found ex :(#import <firebase_analytics/FirebaseAnalyticsPlugin.h>)

// Generated file. Do not edit.
#import "GeneratedPluginRegistrant.h"
#import <firebase_analytics/FirebaseAnalyticsPlugin.h>
#import <firebase_auth/FirebaseAuthPlugin.h>
#import <firebase_core/FirebaseCorePlugin.h>
#import <firebase_storage/FirebaseStoragePlugin.h>
#import <flutter_facebook_login/FacebookLoginPlugin.h>
#import <google_sign_in/GoogleSignInPlugin.h>
#import <image_picker/ImagePickerPlugin.h>
#import <path_provider/PathProviderPlugin.h>
#import <shared_preferences/SharedPreferencesPlugin.h>
#implementation GeneratedPluginRegistrant
+ (void)registerWithRegistry:(NSObject<FlutterPluginRegistry>*)registry {
[FLTFirebaseAnalyticsPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTFirebaseAnalyticsPlugin"]];
[FLTFirebaseAuthPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTFirebaseAuthPlugin"]];
[FLTFirebaseCorePlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTFirebaseCorePlugin"]];
[FLTFirebaseStoragePlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTFirebaseStoragePlugin"]];
[FacebookLoginPlugin registerWithRegistrar:[registry registrarForPlugin:#"FacebookLoginPlugin"]];
[FLTGoogleSignInPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTGoogleSignInPlugin"]];
[FLTImagePickerPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTImagePickerPlugin"]];
[FLTPathProviderPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTPathProviderPlugin"]];
[FLTSharedPreferencesPlugin registerWithRegistrar:[registry registrarForPlugin:#"FLTSharedPreferencesPlugin"]];
}
#end
" Launching lib/main.dart on iPhone XR in debug mode...
Running pod install...
Running Xcode build...
Xcode build done. 9.6s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/******/Documents/****/ios/Runner/GeneratedPluginRegistrant.m:6:9: fatal error: 'firebase_analytics/FirebaseAnalyticsPlugin.h' file not found
#import <firebase_analytics/FirebaseAnalyticsPlugin.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Could not build the application for the simulator.
Error launching application on iPhone XR."
I'm currently using firebase_analytics: 6.0.0 and I didn't encounter any issues during my build on iOS. I've checked the GitHub thread you've shared and it looks like the issue has been solved by updating the plugin version. Another solution posted was to regenerate the pods by running flutter clean and running a build.
For other folks that still have this issue after doing the steps above, you can run flutter doctor -v to check for any errors and warnings and file an Issue here https://github.com/FirebaseExtended/flutterfire/issues

"Error failed to import bridging header" when installing the app on device while working fine for simulator

I'm very new to iOS and I'm coming from the Android background. I've read many post about this issue but I'm unable to resolve this issue.
My problem is that the app runs fine on the iPhone simulator but while running on the device it gives me following error -
error: 'AFNetworking.h' file not found
#import "AFNetworking.h"
^
<unknown>:0: error: failed to import bridging header ‘path/to/project/<main project directory>/projectName-Bridging-Header.h'
Update:
platform :ios, '7.0'
use_frameworks!
target 'SomeTarget' do
pod 'AFNetworking'
pod 'MSDynamicsDrawerViewController'
pod 'KRLCollectionViewGridLayout', '~> 0.2.0'
pod 'Canvas'
pod 'MBProgressHUD'
pod 'RBMenu'
pod 'RKTabView'
pod 'AHTabBarController'
pod 'Fabric'
pod 'Crashlytics'
end
My Bridging Header File
#import "AFNetworking.h"
#import "UIKit+AFNetworking.h"
#import "MSDynamicsDrawerStyler.h"
#import "KRLCollectionViewGridLayout.h"
#import "Canvas.h"
#import "MBProgressHUD.h"
#import "UIScrollView+TwitterCover.h"
#import "A3ParallaxScrollView.h"
#import "ParallaxHeaderView.h"
#import "UIImage+ImageEffects.h"
#import "SGFocusImageFrame.h"
#import "RBMenu.h"
#import "ILBarButtonItem.h"
#import "CMPopTipView.h"
#import "RKTabView.h"
#import "AHTabBarController.h"
#import "UIViewController+MJPopupViewController.h"
#import "NSString+FontAwesome.h"
#import “KMAccordionTableViewController.h"
#import <Crashlytics/Crashlytics.h>
Can you please point the issue I'm getting right now. Why it is running fine on emulator and not on actual device?
This might help somebody.
I've fixed this issue by adding an entry for Header Search Paths to "${PODS_ROOT}/" with recursive. Thanks to lostInTransit for pointing this attribute.
You can find Header Search Paths under BuildSettings for your project target.

Can't debug my iOS project since updating to cocoa pods to use_frameworks! for Swift

After cocoapods 0.38.0 I updated my project to use_frameworks! so that I can make use of Swift modules.
Now whenever I try and debug via lldb I get the following error:
error: Error in auto-import:
failed to get module 'my-app-name' from AST context:
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Path/To/Project/Pods/Target Support Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h"
^
/Path/To/Project/Pods/Target Support Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h:6:9: note: in file included from /Path/To/Project/Pods/Target Support Files/FBSDKCoreKit/FBSDKCoreKit-umbrella.h:6:
#import "FBSDKAppLinkResolver.h"
^
/Path/To/Project/Pods/FBSDKCoreKit/FBSDKCoreKit/FBSDKCoreKit/FBSDKAppLinkResolver.h:26:10: error: include of non-modular header inside framework module 'FBSDKCoreKit.FBSDKAppLinkResolver'
# import <Bolts/BFAppLinkResolving.h>
^
could not build Objective-C module 'FBSDKCoreKit'<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Path/To/Project/Pods/Target Support Files/FBSDKLoginKit/FBSDKLoginKit-umbrella.h"
^
/Path/To/Project/Pods/Target Support Files/FBSDKLoginKit/FBSDKLoginKit-umbrella.h:3:9: note: in file included from /Path/To/Project/Pods/Target Support Files/FBSDKLoginKit/FBSDKLoginKit-umbrella.h:3:
#import "FBSDKLoginButton.h"
^
A fatal parse error has occurred. LLDB may become unstable; please restart your debug session as soon as possible.
I did a bit of digging and found that if you set Allow Non-modular Includes in Framework Modules to yes for the FBSDKCoreKit target in the Pods project, that fixes the LLDB errors.

Resources