HwangTaehyun / react-native-lottie-splash-screen

⚡ Lottie splash screen for your react native app!
MIT License
222 stars 62 forks source link

Not compiling when using AppDelegate.mm #58

Open fbotalla opened 1 year ago

fbotalla commented 1 year ago

Issue is happening when changing the AppDelegate.m to AppDelegate.mm

It works fine with .m It does not compile with .mm with errors in the [project]-Swift file

Attempting to use the forward class 'INIntent' as superclass of 'ConfigurationIntent' && Attempting to use the forward class 'INIntentResponse' as superclass of 'ConfigurationIntentResponse'

Anyone else is having a similar issue?

HwangTaehyun commented 1 year ago

@fbotalla I don't know well about this issue. Could you try this one? https://stackoverflow.com/questions/63425027/attempting-to-use-the-forward-class-nsmanagedobjectmodel-as-superclass-of-swif#:~:text=You%20should%20set%20Enable%20modules(c%20and%20objective%20c)%20in%20build%20setting.%20Add%20%2Dfmodules%20in%20Other%20C%20Flags%2C%20add%20%2Dfcxx%2Dmodules%20in%20Other%20C%2B%2B%20Flags

https://stackoverflow.com/questions/57914899/module-swift-h-file-not-found-in-mm-file-in-building-unity-swift-framework

bradherman commented 1 year ago

Also running into this issue

bradherman commented 1 year ago

Issue is happening when changing the AppDelegate.m to AppDelegate.mm

It works fine with .m It does not compile with .mm with errors in the [project]-Swift file

Attempting to use the forward class 'INIntent' as superclass of 'ConfigurationIntent' && Attempting to use the forward class 'INIntentResponse' as superclass of 'ConfigurationIntentResponse'

Anyone else is having a similar issue?

did you find a fix @fbotalla ?

fbotalla commented 1 year ago

@HwangTaehyun Sorry it took me so long to respond. I did try those fixes but still running into the same issue. @bradherman No, I haven't found a fix. I am currently using .mm without the lottie splash.

HwangTaehyun commented 1 year ago

@fbotalla I will find ways to resolve this within a few weeks. Sorry for being late.

sofian-sunny commented 1 year ago

After some struggle i m able to compile AppDelegate.mm -- instead of AnimationView we have to use LottieAnimationView

AppDelegate.mm code

import "AppDelegate.h"

import <React/RCTBridge.h>

import <React/RCTBundleURLProvider.h>

import <React/RCTRootView.h>

// #import <GoogleMaps/GoogleMaps.h>

import <React/RCTAppSetupUtils.h>

import

import "RNSplashScreen.h" // here

import "Leeway-Swift.h" // here, change project name to yours

//#import <GoogleMaps/GoogleMaps.h>

if RCT_NEW_ARCH_ENABLED

import <React/CoreModulesPlugins.h>

import <React/RCTCxxBridgeDelegate.h>

import "React/RCTBridgeModule.h"

import <React/RCTFabricSurfaceHostingProxyRootView.h>

import <React/RCTSurfacePresenter.h>

import <React/RCTSurfacePresenterBridgeAdapter.h>

import <ReactCommon/RCTTurboModuleManager.h>

import <react/config/ReactNativeConfig.h>

static NSString *const kRNConcurrentRoot = @"concurrentRoot";

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

endif

@implementation AppDelegate

/// This method controls whether the concurrentRootfeature of React18 is turned on or off. /// /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). /// @return: true if the concurrentRoot feture is enabled. Otherwise, it returns false.

ifdef RCT_NEW_ARCH_ENABLED

initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);

endif

return initProps; }

if RCT_NEW_ARCH_ENABLED

pragma mark - RCTCxxBridgeDelegate

pragma mark RCTTurboModuleManagerDelegate

endif

@end

fbotalla commented 1 year ago

@sofian-sunny Thank you for helping out. I am getting this error

Unknown type name 'LottieAnimationView'; did you mean 'AnimationView'?

and also

Attempting to use the forward class 'INIntent' as superclass of 'ConfigurationIntent'

Did you do anything else on your end?

fbotalla commented 1 year ago

@HwangTaehyun I don't want to rush or put pressure, just wanting to check in on the progress ?

Thank you for the awesome library btw.