Need help on using flutter sign_in_with_apple package - flutter

I am trying to implement apple login through my flutter firebase app.
I've done all the process for apple sign in such as appple app id registration, service id registration, ios set up, and firebase hosting.
So I used sign_in_with_apple: ^4.1.0 for my app and I am trying to use example code from the package description. However, if I run the code there are 2 errors to solve
Error: Error when reading 'lib/presenter/firebase/auth/html_shim.dart': No such file or directory
Error: Undefined name 'window'.
i will leave the package link below
https://pub.dev/packages/sign_in_with_apple/example

Related

Firebase authentication error: "class file contains wrong class: io.flutter.plugins.firebase.core.FlutterFirebasePlugin"

I'm using Flutter and Firestore on my application. I decided to use the Firebase authentication library and I have just typed flutter pub add firebase_auth on my terminal.
After running the app through flutter run, I'm having a "bad class file" error for the following route:
build\firebase_auth\intermediates\compile_library_classes_jar\debug\classes.jar(/io/flutter/plugins/firebase/auth/FlutterFirebaseAuthPlugin.class)
The error says:
class file contains wrong class: io.flutter.plugins.firebase.core.FlutterFirebasePlugin
Please remove or make sure it appears in the correct subdirectory of the classpath.
1 error
FAILURE: Build failed with an exception.
I emptied the pub cache, then I removed the firebase authentication package and run the app then it worked again like a charm.
Then I added firebase_auth: ^4.2.8 into my dependencies and typed flutter pub get, then ran the app again and I received the same error!

Please how can i fix this problem Which macos bundle id do you want to use for this configuration, e.g. 'com.example.app'? ·

please how can i fix this problem
Which macos bundle id do you want to use for this configuration, e.g. 'com.example.app'? ·
i have to write the this my self
'com.example.homeapp'
but after that it will just write me these code
FirebaseCommandException: An error occured on the Firebase CLI when attempting to run a command.
COMMAND: firebase apps:create ios home_app (macos) --bundle-id='com.example.homeapp' --json --project=homeapp-f02b4
ERROR: Failed to create iOS app for project homeapp-f02b4. See firebase-debug.log for more info.

SwiftUI: No such Module 'FirebaseAuth'

I've run into a strange issue when trying to setup Firebase sign in with Apple functionality in my app.
It is required to import FirebaseAuth for OAuth functionality. When I try importing it I get the error : "No such Module 'FirebaseAuth'". I have added the package dependencies with package manager and FirebaseAuth is there... but it still gives the error. See screenshot below.
Simply importing Firebase does not give an import error, however I still get errors when trying to use the Authentication functionality. See screenshot below
I've looked for solutions elsewhere but others who have had the same issue as me used Cocoapods to install the packages so their solutions don't apply here.
I am using Xcode 13.0
I fixed the issue by adding FirebaseAuth dependency in build phases:

How to use cloud_firestore in flutter for web and android?

I have a Flutter app which works on Android as expected but if I want to compile it for Web I get an error.
It has to do something with the dependency cloud_firestore. If I use the dependency firebase it works fine on the web but on android now not..
This is the error message I get using cloud_firestore (compiling for web):
Skipping compiling pay_balance|lib/main_web_entrypoint.dart with ddc because some of its
transitive libraries have sdk dependencies that not supported on this platform:
firebase_core|lib/firebase_core.dart
https://github.com/dart-lang/build/blob/master/docs/faq.md#how-can-i-resolve-skipped-compiling-warnings
Can anybody help me? Maybe with another dependency for firestore (I did not find others which are working on web and android)..
Edit: I have used the firebase-dart plugin for web!! -> Only works on the web but not in android for me -> I need something for both at the same time!!
Or is there a Way I can use both packages without getting a compling error for the web when I import cloud_firestore?
If you want to use Firebase on Web and Mobile you have to get creative. I created the fb_auth plugin that uses the Mobile SDK firebase_auth on iOS and Android and the firebase package on web. This will give you a single plugin for auth.
https://pub.dev/packages/fb_auth
Im working on firstore and storage but they are not ready yet.
I have also created an article on how to do this with flutter:
https://medium.com/#rody.davis.jr/how-to-build-a-native-cross-platform-project-with-flutter-372b9e4b504f
You have to use dynamic imports so that at compile time it tree shakes what it doesn't need and will not throw an error.
Currently this is the only way to officially use both plugins in the same project.
EDIT: cloud_firestore now added
Two of the FutterFire plugins are now supported for web. FlutterFire plugins supporting web firebase_auth and firebase_core
cloud_firestore is now also supported

Firebase for Flutter sign-in build failure

I have been following the Firebase for Flutter tutorial with success until I reach "Set up Firebase Integration". When I relaunch the app on my phone the build fails with the following exception:
Note:
/Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/firebase_storage-0.0.2/android/src/main/java/io/flutter/plugins/firebase/storage/FirebaseStoragePlugin.java
uses unchecked or unsafe operations. Note: Recompile with
-Xlint:unchecked for details. /Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/google_sign_in-0.0.6/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java:30:
error: cannot find symbol import
io.flutter.app.FlutterFragmentActivity;
^ symbol: class FlutterFragmentActivity location: package io.flutter.app
/Users/williamdevore/.pub-cache/hosted/pub.dartlang.org/google_sign_in-0.0.6/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java:98:
error: cannot find symbol
+ FlutterFragmentActivity.class.getName());
^ symbol: class FlutterFragmentActivity location: class GoogleSignInPlugin 2 errors
FAILURE: Build failed with an exception.
Flutter doctor says everything is fine for Android. I have the latest "everything". I was able to setup the google-services json file and use the Firebase console with no problems.
I followed the instructions for modifying the build.gradle files exactly--twice!.
Is there some of other step I should be doing outside of the Flutter tutorial that is specific for Android, perhaps Brew or cocoapods maybe?
It looks like you might have an older version of Flutter that doesn't match the Google Sign In plugin version you're using. Right now the plugins aren't declaring which versions of Flutter they require (but that may change in the future).
Does running flutter update get you past this error? If not, try running flutter doctor and see how old your Flutter SDK is. You want it to include the commit b4ba972bf394a2269824e1eadaa1627bbc872d4b, so it should be a few days old at most.
You should replace FlutterActivity with FlutterFragmentActivity in the two places it appears in your MainActivity.java. (This won't be necessary in the next Google Sign In plugin update; see issue 10690.)