Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[🐛] Bug Report Title - No visible @interface for 'FIRAuth' #7267

Closed
2 of 7 tasks
luicfrr opened this issue Jul 27, 2023 · 6 comments
Closed
2 of 7 tasks

[🐛] Bug Report Title - No visible @interface for 'FIRAuth' #7267

luicfrr opened this issue Jul 27, 2023 · 6 comments
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report

Comments

@luicfrr
Copy link

luicfrr commented Jul 27, 2023

Issue

Describe your issue here
I'm having the error no visible @interface for 'FIRAuth' declares the selector 'revokeTokenWithAuthorizationCode:completion:' when compiling with expo with run:ios.

I've tryed deleting the pods and whole ios folder and reinstalled all dependencies. In previous 18.1.0 everything was working fine.


Project Files

Javascript

Click To Expand

package.json:

{
  "name": "rheconhece",
  "version": "1.0",
  "private": true,
  "scripts": {
    "lint": "eslint --quiet --fix --ext .js,.ts .",
    "prebuild": "VARIANT=development npx expo prebuild",
    "prebuild:clean": "VARIANT=development npx expo prebuild --clean",
    "android": "yarn prebuild && VARIANT=development npx expo run:android -d",
    "ios": "yarn prebuild && VARIANT=development npx expo run:ios -d",
    "android:clean": "yarn prebuild:clean && VARIANT=development npx expo run:android -d --no-build-cache",
    "ios:clean": "yarn prebuild:clean && VARIANT=development npx expo run:ios -d --no-build-cache",
    "build:android": "yarn prebuild:clean && yarn dev:android",
    "build:ios": "yarn prebuild:clean && yarn dev:ios",
    "preview:android": "yarn prebuild:prod && yarn prev:android",
    "preview:ios": "yarn prebuild:prod && yarn prev:ios",
    "release:android": "yarn prebuild:prod && npx eas build -e production --local -p android --clear-cache",
    "release:ios": "yarn prebuild:prod && npx eas build -e production --local -p ios --clear-cache",
    "prebuild:prod": "npx expo prebuild --clean",
    "dev:android": "VARIANT=development npx eas build -e development --local -p android --clear-cache",
    "dev:ios": "VARIANT=development npx eas build -e development --local -p ios --clear-cache",
    "prev:android": "npx eas build -e preview --local -p android --clear-cache",
    "prev:ios": "npx eas build -e preview --local -p ios --clear-cache",
    "simulator": "open -a Simulator",
    "emulator": "~/Library/Android/sdk/tools/emulator @Emulator",
    "logcat": "adb logcat \"*:S\" ReactNative:V ReactNativeJS:V",
    "start": "expo start --dev-client"
  },
  "main": "index.js",
  "dependencies": {
    "@config-plugins/react-native-blob-util": "^6.0.0",
    "@config-plugins/react-native-pdf": "^6.0.0",
    "@expo-google-fonts/poppins": "^0.2.3",
    "@nonam4/react-native-bottom-sheet": "^2.2.3",
    "@react-native-firebase/app": "^18.3.0",
    "@react-native-firebase/auth": "^18.3.0",
    "@react-native-firebase/messaging": "^18.3.0",
    "@react-native-google-signin/google-signin": "^10.0.1",
    "@react-navigation/drawer": "^6.6.3",
    "@react-navigation/native": "^6.1.7",
    "@react-navigation/native-stack": "^6.9.13",
    "axios": "^1.4.0",
    "dotenv": "^16.3.1",
    "expo": "^49.0.4",
    "expo-app-loading": "^2.1.1",
    "expo-build-properties": "~0.8.3",
    "expo-camera": "~13.4.2",
    "expo-constants": "~14.4.2",
    "expo-dev-client": "~2.4.6",
    "expo-face-detector": "~12.2.0",
    "expo-font": "~11.4.0",
    "expo-image-manipulator": "~11.3.0",
    "expo-keep-awake": "~12.3.0",
    "expo-linking": "~5.0.2",
    "expo-local-authentication": "~13.4.1",
    "expo-location": "~16.1.0",
    "expo-screen-orientation": "~6.0.3",
    "expo-secure-store": "~12.3.1",
    "expo-sharing": "~11.5.0",
    "expo-splash-screen": "~0.20.4",
    "expo-status-bar": "~1.6.0",
    "expo-system-ui": "~2.4.0",
    "fbjs": "^3.0.5",
    "moment": "^2.29.4",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.72.3",
    "react-native-blob-util": "^0.18.4",
    "react-native-gesture-handler": "~2.12.0",
    "react-native-mask-input": "^1.2.3",
    "react-native-paper": "^5.9.1",
    "react-native-pdf": "^6.7.1",
    "react-native-reanimated": "~3.3.0",
    "react-native-safe-area-context": "4.6.3",
    "react-native-screens": "~3.22.0",
    "react-native-svg": "13.9.0",
    "react-native-text-to-speech": "^4.1.4",
    "react-native-uuid": "^2.0.1",
    "react-native-vector-icons": "^10.0.0",
    "react-native-web": "~0.19.6"
  },
  "devDependencies": {
    "@babel/core": "^7.22.9",
    "@types/node": "^20.4.4",
    "@types/react": "~18.2.14",
    "@types/react-dom": "~18.0.10",
    "@types/react-native": "~0.72.2",
    "@types/react-native-text-input-mask": "^0.7.6",
    "@types/styled-components-react-native": "^5.2.1",
    "@typescript-eslint/eslint-plugin": "^6.1.0",
    "@typescript-eslint/parser": "^6.1.0",
    "babel-plugin-module-resolver": "^5.0.0",
    "babel-plugin-transform-inline-environment-variables": "^0.4.4",
    "concurrently": "^8.2.0",
    "eslint": "^8.45.0",
    "eslint-config-google": "^0.14.0",
    "eslint-config-next": "^13.4.12",
    "eslint-plugin-import": "^2.27.5",
    "eslint-plugin-react": "^7.33.0",
    "miragejs": "^0.1.47",
    "typescript": "^5.1.3"
  },
  "resolutions": {
    "@expo/config-plugins": "^5.0.2"
  }
}

firebase.json for react-native-firebase v6:

# N/A

iOS

Click To Expand

ios/Podfile:

  • I'm not using Pods
  • I'm using Pods and my Podfile looks like:
# Override Firebase SDK Version
$FirebaseSDKVersion = '9.6.0'

require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")

require 'json'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}

ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']

platform :ios, podfile_properties['ios.deploymentTarget'] || '13.0'
install! 'cocoapods',
  :deterministic_uuids => false

prepare_react_native_project!

# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
# because `react-native-flipper` depends on (FlipperKit,...), which will be excluded. To fix this,
# you can also exclude `react-native-flipper` in `react-native.config.js`
#
# ```js
# module.exports = {
#   dependencies: {
#     ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
#   }
# }
# ```
flipper_config = FlipperConfiguration.disabled
if ENV['NO_FLIPPER'] == '1' then
  # Explicitly disabled through environment variables
  flipper_config = FlipperConfiguration.disabled
elsif podfile_properties.key?('ios.flipper') then
  # Configure Flipper in Podfile.properties.json
  if podfile_properties['ios.flipper'] == 'true' then
    flipper_config = FlipperConfiguration.enabled(["Debug", "Release"])
  elsif podfile_properties['ios.flipper'] != 'false' then
    flipper_config = FlipperConfiguration.enabled(["Debug", "Release"], { 'Flipper' => podfile_properties['ios.flipper'] })
  end
end

target 'rheconheceDev' do
  use_expo_modules!
  config = use_native_modules!

  use_frameworks! :linkage => podfile_properties['ios.useFrameworks'].to_sym if podfile_properties['ios.useFrameworks']
  use_frameworks! :linkage => ENV['USE_FRAMEWORKS'].to_sym if ENV['USE_FRAMEWORKS']

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

  use_react_native!(
    :path => config[:reactNativePath],
    :hermes_enabled => podfile_properties['expo.jsEngine'] == nil || podfile_properties['expo.jsEngine'] == 'hermes',
    :fabric_enabled => flags[:fabric_enabled],
    # An absolute path to your application root.
    :app_path => "#{Pod::Config.instance.installation_root}/..",
    # Note that if you have use_frameworks! enabled, Flipper will not work if enabled
    :flipper_configuration => flipper_config
  )

  post_install do |installer|
    react_native_post_install(
      installer,
      config[:reactNativePath],
      :mac_catalyst_enabled => false
    )
    __apply_Xcode_12_5_M1_post_install_workaround(installer)

    # This is necessary for Xcode 14, because it signs resource bundles by default
    # when building for devices.
    installer.target_installation_results.pod_target_installation_results
      .each do |pod_name, target_installation_result|
      target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
        resource_bundle_target.build_configurations.each do |config|
          config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        end
      end
    end
  end

  post_integrate do |installer|
    begin
      expo_patch_react_imports!(installer)
    rescue => e
      Pod::UI.warn e
    end
  end
end

AppDelegate.m:

#import "AppDelegate.h"
#import <Firebase/Firebase.h>

#import <React/RCTBundleURLProvider.h>
#import <React/RCTLinkingManager.h>

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// @generated begin @react-native-firebase/app-didFinishLaunchingWithOptions - expo prebuild (DO NOT MODIFY) sync-ecd111c37e49fdd1ed6354203cd6b1e2a38cccda
[FIRApp configure];
// @generated end @react-native-firebase/app-didFinishLaunchingWithOptions
  self.moduleName = @"main";

  // You can add your custom initial props in the dictionary below.
  // They will be passed down to the ViewController used by React Native.
  self.initialProps = @{};

  return [super application:application didFinishLaunchingWithOptions:launchOptions];
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
  return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@".expo/.virtual-metro-entry"];
#else
  return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
}

// Linking API
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options {
  return [super application:application openURL:url options:options] || [RCTLinkingManager application:application openURL:url options:options];
}

// Universal Links
- (BOOL)application:(UIApplication *)application continueUserActivity:(nonnull NSUserActivity *)userActivity restorationHandler:(nonnull void (^)(NSArray<id<UIUserActivityRestoring>> * _Nullable))restorationHandler {
  BOOL result = [RCTLinkingManager application:application continueUserActivity:userActivity restorationHandler:restorationHandler];
  return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || result;
}

// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{
  return [super application:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
}

// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
- (void)application:(UIApplication *)application didFailToRegisterForRemoteNotificationsWithError:(NSError *)error
{
  return [super application:application didFailToRegisterForRemoteNotificationsWithError:error];
}

// Explicitly define remote notification delegates to ensure compatibility with some third-party libraries
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler
{
  return [super application:application didReceiveRemoteNotification:userInfo fetchCompletionHandler:completionHandler];
}

@end


Android

Works fine on android


Environment

Click To Expand

react-native info output:

❌  (node_modules/@react-native-firebase/auth/ios/RNFBAuth/RNFBAuthModule.m:672:7)

  670 |                   : (RCTPromiseRejectBlock)reject) {
  671 |   [[FIRAuth authWithApp:firebaseApp]
> 672 |       revokeTokenWithAuthorizationCode:authorizationCode
      |       ^ no visible @interface for 'FIRAuth' declares the selector 'revokeTokenWithAuthorizationCode:completion:'
  673 |                             completion:^(NSError *_Nullable error) {
  674 |                               if (error) {
  675 |                                 [self promiseRejectAuthException:reject error:error];
  • Platform that you're experiencing the issue on:
    • iOS
    • Android
    • iOS but have not tested behavior on Android
    • Android but have not tested behavior on iOS
    • Both
  • react-native-firebase version you're using that has this issue:
    • 18.1.0 -
  • Firebase module(s) you're using that has the issue:
    • auth
  • Are you using TypeScript?
    • Y & latest


@luicfrr luicfrr added help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report labels Jul 27, 2023
@lngdao
Copy link

lngdao commented Jul 29, 2023

I encountered a similar issue with version 18.3.0. I think you should try changing the version. I tested 17.4.3, and everything is working fine again.

@mdashikur9090
Copy link

i am also facing same with with the version 18.3.0

@tuanngocptn
Copy link

Rollback to v17.4.3 is working for me. Thank @lngdao

@luicfrr
Copy link
Author

luicfrr commented Aug 11, 2023

I think this error is something related to new 0.72 react-native or new 49 expo version. I have a project using expo 48 and rn 0.71 with react-native-firebase at 18.1 and it's working nice but with 0.72 and 49 (even keeping rnfirebase the same) this error hapens

@bigboss97lnt
Copy link

+1

@mikehardy
Copy link
Collaborator

Hi there! The error is related to a new API added in react-native-firebase 18.3.0

https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md#1830-2023-07-19
https://github.com/invertase/react-native-firebase/blob/main/CHANGELOG.md#features

auth, revokeToken: sign in with apple revokeToken API (#7239) (2b9dc73)

In that review I noted this as a potential break #7239 (review)

Thanks! Just verified this has been out for a while (firebase-ios-sdk 10.8.0) which shouldn't be a breaking change for anyone since I did a break on the firebase-ios-sdk 10.8.0 release itself

...however it should not have affected anyone that followed the breaking change process from v17 to v18 of react-native-firebase, as that required firebase-ios-sdk 10.8.0, which is the minimum requirement for the added API released in

It seems that you could either remain on react-native-firebase 18.2.0 (not recommended) or you could make sure that you have truly adopted the correct + up to date firebase-ios-sdk underlying (currently at 10.14.0, may versions past 10.8.0). Specifically if you have an override set in your Podfile, you might remove that (recommended) or at least bump it to 10.8.0+ (ideally 10.14.0)

This is not a bug in react-native-firebase though, just a versioning misalignment that I believe is project-specific. I don't think there is anything more actionable here besides the information + suggestions I've posted above so I'll close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help: needs-triage Issue needs additional investigation/triaging. type: bug New bug report
Projects
None yet
Development

No branches or pull requests

6 participants