Error: Unsupported operation: Platform._operatingSystem - firebase

I want build app flutter on web but I get error when I run
flutter run -d chrome
error
Error: Unsupported operation: Platform._operatingSystem
at Object.throw_ [as throw] (http://localhost:55259/dart_sdk.js:5334:11)
at Function._operatingSystem (http://localhost:55259/dart_sdk.js:56144:17)
at Function.get operatingSystem [as operatingSystem] (http://localhost:55259/dart_sdk.js:56190:27)
at get _operatingSystem (http://localhost:55259/dart_sdk.js:56103:27)
at Function.desc.get [as _operatingSystem] (http://localhost:55259/dart_sdk.js:5839:17)
at Function.get operatingSystem [as operatingSystem] (http://localhost:55259/dart_sdk.js:56056:26)
at main$ (http://localhost:55259/packages/doxaspc/main.dart.lib.js:205:48)
at main$.next (<anonymous>)
at http://localhost:55259/dart_sdk.js:39032:33
at _RootZone.runUnary (http://localhost:55259/dart_sdk.js:38889:58)
at _FutureListener.thenAwait.handleValue (http://localhost:55259/dart_sdk.js:33875:29)
at handleValueCallback (http://localhost:55259/dart_sdk.js:34435:49)
at Function._propagateToListeners (http://localhost:55259/dart_sdk.js:34473:17)
at _Future.new.[_completeWithValue] (http://localhost:55259/dart_sdk.js:34315:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:55259/dart_sdk.js:34338:35)
at Object._microtaskLoop (http://localhost:55259/dart_sdk.js:39176:13)
at _startMicrotaskLoop (http://localhost:55259/dart_sdk.js:39182:13)
at http://localhost:55259/dart_sdk.js:34689:9
function main of me
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await Firebase.initializeApp();
runApp(MyApp());
}
I have build a app android and it work good. but when I want anable web see error above
please show me how fix it?

I had the same error with a mobile flutter app to configure in Web.
It was because some packages are available only for Android and IOS, and not for the Web.
Maybe you should replace your packages with an equivalent available for all platforms.

FlutterFire plugins for web may still be errorneous
Please follow the guide as suggested here

Related

FirebaseError: Installations: Create Installation request failed with error "403 PERMISSION_DENIED

I was working with Firebase with Angular framework in a project. I was using Firebase for sending push notifications. I followed this medium article and did like this. Everything was perfect up to allowing notification alerts. But after that token didn't print on the console and this error popped up.
`
notifications.component.ts:169 FirebaseError: Installations: Create Installation request failed with error "403 PERMISSION_DENIED: Requests to this API firebaseinstallations.googleapis.com method google.firebase.installations.v1.FirebaseInstallationsService.CreateInstallation are blocked." (installations/request-failed).
at index.esm2017.js:94:26
at Generator.next (<anonymous>)
at asyncGeneratorStep (asyncToGenerator.js:3:1)
at _next (asyncToGenerator.js:25:1)
at ZoneDelegate.invoke (zone.js:372:1)
at Object.onInvoke (core.mjs:25488:1)
at ZoneDelegate.invoke (zone.js:371:1)
at Zone.run (zone.js:134:1)
at zone.js:1276:1
at ZoneDelegate.invokeTask (zone.js:406:1)
`
And I found this StackOverflow answer as well and I did the same as that suggested. But still it gives the error.
Can someone help me with this?

How should I host the website on firebase?

after calling firebase init in vs code terminal, then opting Hosting, then opting to choose the existing projects
i am facing the below error
Error: Failed to list Firebase projects. See firebase-debug.log for more info.
how should i resolve it?
firebase log file
at Client.doRequest (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:209:23)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Client.request (/usr/local/lib/node_modules/firebase-tools/lib/apiv2.js:96:20)
at async getProjectPage (/usr/local/lib/node_modules/firebase-tools/lib/management/projects.js:233:17)
at async getFirebaseProjectPage (/usr/local/lib/node_modules/firebase-tools/lib/management/projects.js:250:23)
at async selectProjectInteractively (/usr/local/lib/node_modules/firebase-tools/lib/management/projects.js:95:41)
at async Object.doSetup [as project] (/usr/local/lib/node_modules/firebase-tools/lib/init/features/project.js:87:27)
at async init (/usr/local/lib/node_modules/firebase-tools/lib/init/index.js:19:9)
[error]
[error] Error: Failed to list Firebase projects. See firebase-debug.log for more info.
please guide

Flutter Web, Flutter Firebase Authentication issue

Running the flutter app on the web I'm getting an exception only when the login is successful, when the the credentials are wrong the firebase_auth check works properly returning check validation that (Incorrect email address or password, please try again).
Error: MissingPluginException(No implementation found for method Query#observe on channel plugins.flutter.io/firebase_database)
at Object.throw_ [as throw] (http://localhost:18539/dart_sdk.js:5333:11)
at MethodChannel._invokeMethod (http://localhost:18539/packages/flutter/src/services/system_channels.dart.lib.js:954:21)
at _invokeMethod.next (<anonymous>)
at http://localhost:18539/dart_sdk.js:39031:33
at _RootZone.runUnary (http://localhost:18539/dart_sdk.js:38888:58)
at _FutureListener.thenAwait.handleValue (http://localhost:18539/dart_sdk.js:33874:29)
at handleValueCallback (http://localhost:18539/dart_sdk.js:34434:49)
at Function._propagateToListeners (http://localhost:18539/dart_sdk.js:34472:17)
at _Future.new.[_completeWithValue] (http://localhost:18539/dart_sdk.js:34314:23)
at async._AsyncCallbackEntry.new.callback (http://localhost:18539/dart_sdk.js:34337:35)
at Object._microtaskLoop (http://localhost:18539/dart_sdk.js:39175:13)
at _startMicrotaskLoop (http://localhost:18539/dart_sdk.js:39181:13)
at http://localhost:18539/dart_sdk.js:34688:9
So far I've tried the solutions here https://github.com/flutter/flutter/issues/13971 , I/flutter (22027): MissingPluginException(No implementation found for method DocumentReference#setData on channel plugins.flutter.io/cloud_firestore) running
flutter clean
flutter packages get
Also deleting the file
pubspec.lock
And running flutter packages get
This issue occurs only when flutter app is running on the web, on android and iOS devices it runs correctly
Also try to add the firebase_auth_web and firebase_storage_web
Flutter 2.0.4 • channel stable
Framework • revision b1395592de (3 weeks ago) • 2021-04-01 14:25:01 -0700
Engine • revision 2dce47073a
Tools • Dart 2.12.2
# Firebase dependencies
firebase_core: ^0.5.3
firebase_database: ^4.4.0
firebase_auth: ^0.18.4+1
firebase_storage: ^4.0.0
firebase_storage_web:
firebase_messaging: ^7.0.3

Firebase auth issue on flutter web

So, issue is simple at first glance:
createUserWithEmailAndPassword() method on Flutter web does not work on my project.
It just gives this error evey time:
xhrio.js:630 POST https://www.googleapis.com/identitytoolkit/v3/relyingparty/signupNewUser?key=//here is my key, obviosly not showing
net::ERR_CONNECTION_REFUSED
and
errors.dart:187 Uncaught (in promise) Error: [firebase_auth/network-request-failed] A network error (such as timeout, interrupted connection or unreachable host) has occurred.
at Object.throw_ [as throw] (errors.dart:236)
at firebase_auth_web.FirebaseAuthWeb.new.createUserWithEmailAndPassword (firebase_auth_web.dart:157)
at createUserWithEmailAndPassword.throw (<anonymous>)
at async_patch.dart:60
at _RootZone.runBinary (zone.dart:1617)
at _FutureListener.thenAwait.handleError (future_impl.dart:166)
at handleError (future_impl.dart:716)
at Function._propagateToListeners (future_impl.dart:737)
at _Future.new.[_completeError] (future_impl.dart:547)
at async._AsyncCallbackEntry.new.callback (future_impl.dart:603)
at Object._microtaskLoop (schedule_microtask.dart:40)
at _startMicrotaskLoop (schedule_microtask.dart:49)
at async_patch.dart:166
PLEASE BE NOTED - flutter doctor is COMPLETELY GREEN, all is connected, et cetera et cetera. Trust me, i'm not a newbie at this one. And all is working perfectly on adroid emulator.
I've tried everything. Adressed it on reddit, created issue in github - nothing.
Any ideas?
Checking windows hosts file worked (i edited it for my purposes).

React Native FCM push notification token null

I'm working on a React Native project and i need to set up push notifications on iOS and Android ends using react-native-fcm,
When i try to get a token it return null in Android and the following error on iOS:
Possible Unhandled Promise Rejection (id: 0):
TypeError: Cannot read property 'requestPermissions' of undefined
TypeError: Cannot read property 'requestPermissions' of undefined
at Object.FCM.requestPermissions (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:143309:27)
at PushNotificationController.componentDidMount$ (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:143144:58)
at tryCatch (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:16751:19)
at Generator.invoke [as _invoke] (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:16924:24)
at Generator.prototype.(anonymous function) [as next] (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:16794:23)
at tryCatch (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:16751:19)
at invoke (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:16827:22)
at blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:16855:13
at tryCallTwo (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:3524:7)
at doResolve (blob:http://localhost:8081/4a6e4d63-516d-4288-ac74-d1494e78d48f:3688:15)
Thanks for responding and i'm available for further information.

Resources