Skip to content

iOS build fails with "value of optional type ... must be unwrapped" error #247

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

Closed
hendrickson-tyler opened this issue Mar 17, 2024 · 0 comments · Fixed by #246
Closed

iOS build fails with "value of optional type ... must be unwrapped" error #247

hendrickson-tyler opened this issue Mar 17, 2024 · 0 comments · Fixed by #246

Comments

@hendrickson-tyler
Copy link
Contributor

Been facing some issues with my iOS builds using the Firebase plugins recently. I'm not sure if this is related to an Xcode update or what, but xcodebuild fails with the following error for each of the plugins I'm using:

/Users/tylerhendrickson/Developer/actions-runner/_work/my-app/my-app/apps/mobile/platforms/ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:73:12: 
error: value of optional type '(any StorageProvider)?' must be unwrapped to refer to member 'storage' of wrapped base type 'any StorageProvider'
    return provider.storage(for: Storage.bucket(for: app))
           ^

It looks like this error was also experienced in React Native and Flutter, but is fixed by updating to use v10.22.0+ of the SDKs. I can confirm that this fixes the issue as patching each of the plugins in my project fixes the build:

diff --git a/node_modules/@nativescript/firebase-auth/platforms/android/firebase_auth.aar b/node_modules/@nativescript/firebase-auth/platforms/android/firebase_auth.aar
index d9a8772..06e7107 100644
Binary files a/node_modules/@nativescript/firebase-auth/platforms/android/firebase_auth.aar and b/node_modules/@nativescript/firebase-auth/platforms/android/firebase_auth.aar differ
diff --git a/node_modules/@nativescript/firebase-auth/platforms/ios/Podfile b/node_modules/@nativescript/firebase-auth/platforms/ios/Podfile
index ed41821..c419be6 100644
--- a/node_modules/@nativescript/firebase-auth/platforms/ios/Podfile
+++ b/node_modules/@nativescript/firebase-auth/platforms/ios/Podfile
@@ -1,2 +1,2 @@
 platform :ios, '12.0'
-pod 'Firebase/Auth', '~>10.20.0'
\ No newline at end of file
+pod 'Firebase/Auth', '~>10.22.0'

I've created a quick PR on this for consideration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant