FormidableLabs / react-native-app-auth

React native bridge for AppAuth - an SDK for communicating with OAuth2 providers
https://commerce.nearform.com/open-source/react-native-app-auth
MIT License
1.96k stars 438 forks source link

'RNAppAuthAuthorizationFlowManager.h' file not found #956

Open raffojoao opened 3 months ago

raffojoao commented 3 months ago

Issue

Hello,

I'm encountering this error in AppDelegate.h after upgrading from RN 0.61.5 to 0.69.12. I have already attempted the solutions proposed here, but none of them seemed to work. Any ideas?

Here is the content of AppDelegate.h:

#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
#import <React/RCTLinkingManager.h>
#import <AppAuth/AppAuth.h>
#import "RNAppAuthAuthorizationFlowManager.h"

@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate, RNAppAuthAuthorizationFlowManager>

@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, weak) id<RNAppAuthAuthorizationFlowManagerDelegate> authorizationFlowManagerDelegate;

@end

And Podfile:

require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

def shared_pods
  $RNFirebaseAsStaticFramework = true
  pod 'Firebase', :modular_headers => true
  pod 'FirebaseCore', :modular_headers => true
  pod 'FirebaseCoreInternal', :modular_headers => true
  pod 'GoogleUtilities', :modular_headers => true
  pod 'Permission-AppTrackingTransparency', :path => "../node_modules/react-native-permissions/ios/AppTrackingTransparency"
  pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS'
  pod 'AppAuth', '>= 0.91'
end

target 'stix dev' do
  config = use_native_modules!

  # Flags change depending on the env values.
  flags = get_default_flags()

  use_react_native!(
    :path => config[:reactNativePath],
    # to enable hermes on iOS, change `false` to `true` and then install pods
    :hermes_enabled => false,
    :fabric_enabled => flags[:fabric_enabled],
    # :flipper_configuration => FlipperConfiguration.enabled,
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/.."
  )

  use_frameworks! :linkage => :static
  # Pods for stix
  shared_pods

  def find_and_replace(dir, findstr, replacestr)
    Dir[dir].each do |name|
        text = File.read(name)
        replace = text.gsub(findstr,replacestr)
        if text != replace
            puts "Fix: " + name
            File.open(name, "w") { |file| file.puts replace }
            STDOUT.flush
        end
    end
    Dir[dir + '*/'].each(&method(:find_and_replace))
  end

  post_install do |installer|
    react_native_post_install(installer)
    __apply_Xcode_12_5_M1_post_install_workaround(installer)
  end

end

target 'stix dev (embedded)' do
  # Pods for stix
  shared_pods
end

target 'stix staging' do
  # Pods for stix
  shared_pods
end

target 'stix staging (embedded)' do
  # Pods for stix
  shared_pods
end

target 'stix' do
  # Pods for stix
  shared_pods
end

target 'stix (embedded)' do
  # Pods for stix
  shared_pods
end

Environment

richardReitz commented 2 months ago

Same issue!

faizplus commented 1 month ago

@raffojoao I am not able to reproduce this issue. Can you create a repo where this can be reproduced? Also have a look at react native upgrade tool for your version and troubleshooting section