Skip to content

[🐛⚠️] iOS Build Fails - Value of optional type '?' must be unwrapped to refer to member 'storage' of wrapped base type 'any StorageProvider' (Optional Chaining) #7666

@victoriomolina

Description

@victoriomolina

Scenario

Last week I was able to compile my project (Expo EAS Build) without errors.

Today, without modifying anything (didn't upgrade any dependency), I have started getting this error on my iOS AdHoc compilation:

Run Fastlane Errors

Copying   @react-native-firebase/storage ../../../Users/expo/Library/Developer/Xcode/DerivedData/Advice-dzlzwedukqkcvxgkbpzvxdpjkyli/Build/Intermediates.noindex/ArchiveIntermediates/Advice/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseStorage.framework/Headers/FirebaseStorage-umbrella.h ➜ ios/Pods/Target/ Support/ Files/FirebaseStorage/FirebaseStorage-umbrella.h

› Copying   @react-native-firebase/storage ../../../Users/expo/Library/Developer/Xcode/DerivedData/Advice-dzlzwedukqkcvxgkbpzvxdpjkyli/Build/Intermediates.noindex/ArchiveIntermediates/Advice/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/FirebaseStorage.framework/Headers/FIRStorageTypedefs.h ➜ ios/Pods/FirebaseStorage/FirebaseStorage/Typedefs/FIRStorageTypedefs.h

❌  (/Users/expo/workingdir/build/packages/app/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:73:12)

  71 |     let provider = ComponentType<StorageProvider>.instance(for: StorageProvider.self,
  72 |                                                            in: app.container)
> 73 |     return provider.storage(for: Storage.bucket(for: app))
     |            ^ value of optional type '?' must be unwrapped to refer to member 'storage' of wrapped base type 'any StorageProvider'
  74 |   }
  75 | 
  76 |   /**

❌  (/Users/expo/workingdir/build/packages/app/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:88:12)

  86 |     let provider = ComponentType<StorageProvider>.instance(for: StorageProvider.self,
  87 |                                                            in: app.container)
> 88 |     return provider.storage(for: Storage.bucket(for: app, urlString: url))
     |            ^ value of optional type '?' must be unwrapped to refer to member 'storage' of wrapped base type 'any StorageProvider'
  89 |   }
  90 | 
  91 |   /**

❌  (/Users/expo/workingdir/build/packages/app/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:291:39)

  289 |   init(app: FirebaseApp, bucket: String) {
  290 |     self.app = app
> 291 |     auth = ComponentType<AuthInterop>.instance(for: AuthInterop.self,
      |                                       ^ cannot assign value of type '?' to type 'any AuthInterop'
  292 |                                                in: app.container)
  293 |     appCheck = ComponentType<AppCheckInterop>.instance(for: AppCheckInterop.self,
  294 |                                                        in: app.container)

❌  (/Users/expo/workingdir/build/packages/app/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:293:47)

  291 |     auth = ComponentType<AuthInterop>.instance(for: AuthInterop.self,
  292 |                                                in: app.container)
> 293 |     appCheck = ComponentType<AppCheckInterop>.instance(for: AppCheckInterop.self,
      |                                               ^ cannot assign value of type '?' to type 'any AppCheckInterop'
  294 |                                                        in: app.container)
  295 |     storageBucket = bucket
  296 |     host = "firebasestorage.googleapis.com"

Package Versions

Since I was using the following dependencies

    "@react-native-firebase/analytics": "^18.7.3",
    "@react-native-firebase/app": "^18.7.3",
    "@react-native-firebase/auth": "^18.7.3",
    "@react-native-firebase/firestore": "^18.7.3",
    "@react-native-firebase/functions": "^18.7.3",
    "@react-native-firebase/storage": "^18.7.3",

I decided to upgrade to the latest one @^19.0.0.

    "@react-native-firebase/analytics": "^19.0.0",
    "@react-native-firebase/app": "^19.0.0",
    "@react-native-firebase/auth": "^19.0.0",
    "@react-native-firebase/firestore": "^19.0.0",
    "@react-native-firebase/functions": "^19.0.0",
    "@react-native-firebase/storage": "^19.0.0",

I have also tried upgrading EAS with Expo 48, 49 and the latest release and images, with CocoaPods v1.15.2, and the error still persists.

Is anyone experiencing the same issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    help: needs-triageIssue needs additional investigation/triaging.type: bugNew bug report

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions