question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error in AppDelegate.mm after following plugin integration

See original GitHub issue

Run react-native info in your project and share the content. System: OS: macOS 10.15.7 CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz Memory: 1.34 GB / 32.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node Yarn: 1.22.5 - /usr/local/bin/yarn npm: 6.14.15 - ~/.nvm/versions/node/v14.17.6/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2 Android SDK: Not Found IDEs: Android Studio: 4.1 AI-201.8743.12.41.6953283 Xcode: 12.4/12D4e - /usr/bin/xcodebuild Languages: Java: 11.0.15 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.1 => 0.68.1 react-native-macos: Not Found npmGlobalPackages: *react-native*: Not Found

What react-native-splash-screen version are you using? 0.1.14

What platform does your issue occur on? (Android/iOS/Both) iOS

Describe your issue as precisely as possible : I followed the documentation for iOS integration and been stuck on this issue. When i try to run from xcode i get this error. Cannot initialize a variable of type 'UIView *__strong' with an rvalue of type 'AnimationView *'

Join a screenshot or video of the problem on the simulator or device? Screenshot 2022-05-13 at 1 41 43 PM

Show us the code you are using? AppDelegat.mm file `#import “AppDelegate.h”

#import <React/RCTBridge.h> #import <React/RCTBundleURLProvider.h> #import <React/RCTRootView.h> #import “RNSplashScreen.h” #import “Quickzy-Swift.h”

#import <React/RCTAppSetupUtils.h> #import <CodePush/CodePush.h>

#if RCT_NEW_ARCH_ENABLED #import <React/CoreModulesPlugins.h> #import <React/RCTCxxBridgeDelegate.h> #import <React/RCTFabricSurfaceHostingProxyRootView.h> #import <React/RCTSurfacePresenter.h> #import <React/RCTSurfacePresenterBridgeAdapter.h> #import <ReactCommon/RCTTurboModuleManager.h>

#import <react/config/ReactNativeConfig.h>

@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> { RCTTurboModuleManager *_turboModuleManager; RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; std::shared_ptr<const facebook::react::ReactNativeConfig> _reactNativeConfig; facebook::react::ContextContainer::Shared _contextContainer; } @end #endif

@implementation AppDelegate

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { RCTAppSetupPrepareApp(application);

    RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];

#if RCT_NEW_ARCH_ENABLED _contextContainer = std::make_shared<facebook::react::ContextContainer const>(); _reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>(); _contextContainer->insert(“ReactNativeConfig”, _reactNativeConfig); _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; #endif

UIView *rootView = RCTAppSetupDefaultRootView(bridge, @“Quickzy”, nil);

if (@available(iOS 13.0, *)) { rootView.backgroundColor = [UIColor systemBackgroundColor]; } else { rootView.backgroundColor = [UIColor whiteColor]; }

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; UIViewController *rootViewController = [UIViewController new]; rootViewController.view = rootView; self.window.rootViewController = rootViewController; [self.window makeKeyAndVisible];

Dynamic *t = [Dynamic new]; UIView *animationView = [t createAnimationViewWithRootView:rootView lottieName:@“loading”]; // change lottieName to your lottie files name animationView.backgroundColor = [UIColor whiteColor]; // change backgroundColor

// register LottieSplashScreen to RNSplashScreen [RNSplashScreen showLottieSplash:animationView inRootView:rootView];

// play [t playWithAnimationView:animationView];

// If you want the animation layout to be forced to remove when hide is called, use this code [RNSplashScreen setAnimationFinished:true];

return YES; }

  • (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { #if DEBUG return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@“index”]; #else return [CodePush bundleURL]; #endif }

#if RCT_NEW_ARCH_ENABLED

#pragma mark - RCTCxxBridgeDelegate

  • (std::unique_ptrfacebook::react::JSExecutorFactory)jsExecutorFactoryForBridge:(RCTBridge *)bridge { _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge delegate:self jsInvoker:bridge.jsCallInvoker]; return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); }

#pragma mark RCTTurboModuleManagerDelegate

  • (Class)getModuleClassFromName:(const char *)name { return RCTCoreModulesClassProvider(name); }

  • (std::shared_ptrfacebook::react::TurboModule)getTurboModule:(const std::string &)name jsInvoker:(std::shared_ptrfacebook::react::CallInvoker)jsInvoker { return nullptr; }

  • (std::shared_ptrfacebook::react::TurboModule)getTurboModule:(const std::string &)name initParams: (const facebook::react::ObjCTurboModule::InitParams &)params { return nullptr; }

  • (id<RCTTurboModule>)getModuleInstanceFromClass:(Class)moduleClass { return RCTAppSetupDefaultModuleFromClass(moduleClass); }

#endif

@end`

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

11reactions
luispiresgympasscommented, Jun 9, 2022

I did a solution that makes it work by doing some conversion type. I hope that helps you guys @omniviewsports and @dibakr-halder-udaan

  • React-Native v0.68

Untitled

1reaction
saad277commented, Jun 29, 2022

Thanks @HwangTaehyun !

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting errors when change AppDelegate.m to .mm
I have an issue in changing from .m to .mm extension. I have an appdelegate class. Initially it ...
Read more >
Build input file cannot be found: '...AppDelegate.m' · Issue ...
Description I believe I'm following the installation instructions correctly, however I can't seem to get the project to run.
Read more >
React Native SDK Troubleshooting - Visual Studio App Center
This error appears when RN core libraries aren't referenced correctly, which can be caused by different kinds of integrating or linking issues.
Read more >
Updating to iOS SDK V6 and plugins - AppsFlyer support
To update to iOS SDK V6, complete the procedures (1-5) that follow. 1. Update SDK version. Download and add the SDK V6 to...
Read more >
Add expo-updates to an existing project - Expo Documentation
Once installation is complete, apply the changes from the following diffs to ... There are multiple changes to apply to your project's AppDelegate.mm....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found