using Agora - PlatformException(7, not initialized, null, null) - android

E/flutter (31727): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: PlatformException(7, not initialized, null, null)
E/flutter (31727): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter (31727): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167:18)
E/flutter (31727): <asynchronous suspension>
I am using Agora for Flutter for video broadcasting.
I am getting above exceptions when I leave channel and destroy rtc engine. Any hints to fix this? There are no logs suggesting reason for the error.

here:
const ErrorCode(7)
NotReady → const ErrorCode
The SDK module is not ready. Possible
solutions:
Check the audio device.
Check the completeness of the app.
Re-initialize the SDK.
You may check your code about the engine's create.

The error code 7 occurs when the SDK fails to initialize. Most commonly the error can be due to an incorrect APP ID or missing/expired token.

Related

Flutter Google Sign In error after selecting User Id: PlatformException(sign_in_failed, v1.b: 10: , null, null)

I'm currently developing a Flutter Application for android and the web. However, the google sign-in feature is not working in the release mode or when you install an APK. It does work in Debug and Profile modes. I've tried numerous solutions, including changing the version dependencies of all firebase packages and the Google sign-in package. Updated Gradle, fixed the warning for "JAR files in the classpath should have the same version" and tried a few possible logic changes in the Authentication service code. Although the latter hardly seems to be the problem because the code is working in Debug mode and it was also previously working smoothly (in all modes).
I should mention the fact that I have added both SHA certificates (SHA 1 and SHA 256) from my laptop and also from the play store to make it ready for publishing but it didn't change anything. I also tried removing the Playstore SHA certificates but it doesn't help the problem either.
The error appears after the user clicks on the "Sign In with Google" Button and selects their google account. Below is the exact error I am facing (apart from Google Sign in other authentication services work).
E/flutter (13968): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(sign_in_failed, v1.b: 10: , null, null)
E/flutter (13968): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607)
E/flutter (13968): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:167)
E/flutter (13968): <asynchronous suspension>
E/flutter (13968): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:367)
E/flutter (13968): <asynchronous suspension>
E/flutter (13968): #3 GoogleSignIn._callMethod (package:google_sign_in/google_sign_in.dart:266)
E/flutter (13968): <asynchronous suspension>
E/flutter (13968): #4 GoogleSignIn.signIn.isCanceled (package:google_sign_in/google_sign_in.dart:399)
E/flutter (13968): <asynchronous suspension>
E/flutter (13968):
These are the version numbers of all my flutterfire packages and also google sign in:
cloud_firestore: ^3.3.0
firebase_auth: ^3.5.1
firebase_core: ^1.20.1
firebase_messaging: ^12.0.0
firebase_storage: ^10.2.18
google_sign_in: ^5.4.0
firebase_analytics: ^9.2.1
NOTE: There is also a web version of the app, that is running fine in all run modes.
I would really appreciate any inputs on this problem! Thank you.
EDIT: Figured it out. Your release and debug SHA keys are different. First of all, add your debug SHA keys to firebase if it still doesn't work, add your release SHA key to firebase. Hope it will work!

Camera problem not generating caption android emulator flutter android studio 2022

this is a new question. I am creating an image caption generator app , so what happening is every time I try to use the live camera it catches a picture but its not generating caption for it. please help
E/flutter ( 4788): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: PlatformException(no_available_camera, No cameras available for taking pictures., null, null)
E/flutter ( 4788): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:607:7)
E/flutter ( 4788): #1 MethodChannel._invokeMethod

Unhandled Exception: MissingPluginException(No implemen tation found for method login on channel app.meedu/flutter_facebook_auth)

I'm getting the following error when I'm tring to sign in with facebook on android device by my flutter app :
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method login on channel app.meedu/flutter_facebook_auth)
E/flutter (29705): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
E/flutter (29705):
E/flutter (29705): #1 FacebookAuthPlatformImplementation.login (package:flutter_facebook_auth_platform_interface/src/facebook_auth_implementation.dart:34:22)
E/flutter (29705):
You have to restart your app.
Flutter has to inject plugin dependencies into the platform-specific parts of your app, hot restart/hot reload is not enough to trigger the injection. Check this issue for more.
Close the app and execute flutter run command.
Stop the iPhone / Android app.
Re-run application & make sure you did flutter pub get
It's work for me but Let me know if it's not work for you.

Flutter, IOS, App with name __FIRAPP_DEFAULT does not exist

I am new to IOS. I followed the guide and ran the code running on Android on IOS.
But in the log appears
021-02-18 13:02:42.035498+0900 Runner[449:77215] Metal API Validation Enabled
2021-02-18 13:02:42.128775+0900 Runner[449:77215] Configuring the default Firebase app...
2021-02-18 13:02:42.129033+0900 Runner[449:77424] 6.33.0 - [Firebase/Core][I-COR000004] App with name __FIRAPP_DEFAULT does not exist.
2021-02-18 13:02:42.132427+0900 Runner[449:77215] Configured the default Firebase app __FIRAPP_DEFAULT.
2021-02-18 13:02:42.174670+0900 Runner[449:77440] flutter: Observatory listening on http://127.0.0.1:51553/bOh9A8fqOm4=/
2021-02-18 13:02:42.506046+0900 Runner[449:77425] 6.33.0 - <AppMeasurement>[I-ACS025027] Deferring to Google Analytics for Firebase for event data collection.
2021-02-18 13:02:42.627177+0900 Runner[449:77215] WF: === Starting WebFilter logging for process Runner
2021-02-18 13:02:42.627226+0900 Runner[449:77215] WF: _userSettingsForUser mobile: {
filterBlacklist = (
);
filterWhitelist = (
);
restrictWeb = 1;
useContentFilter = 0;
useContentFilterOverrides = 0;
whitelistEnabled = 0;
}
2021-02-18 13:02:42.627266+0900 Runner[449:77215] WF: _WebFilterIsActive returning: NO
2021-02-18 13:02:42.672715+0900 Runner[449:77429] [VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method addFlags on channel flutter_windowmanager)
#0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157:7)
<asynchronous suspension>
#1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:332:12)
#2 FlutterWindowManager.addFlags (package:flutter_windowmanager/flutter_windowmanager.dart:44:27)
#3 main (package:k_leetory/main.dart:14:30)
<asynchronous suspension>
#4 _runMainZoned.<anonymous closure>.<anonymous closure> (dart:ui/hooks.dart:231:25)
#5 _rootRun (dart:async/zone.dart:1190:13)
#6 _CustomZone.run (dart:async/zone.dart:1093:19)
#7 _runZoned (dart:async/zone.dart:1630:10)
#8 runZonedGuarded (dart:async/zone.dart:1618:12)
#9 _runMainZoned.<anonymous closure> (dart:ui/hooks.dart:223:5)
#10 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)
#11 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
2021-02-18 13:05:02.684451+0900 Runner[449:77432] [VERBOSE-2:profiler_metrics_ios.mm(184)] Error retrieving thread information: (ipc/send) invalid destination port
2021-02-18 13:10:21.957514+0900 Runner[449:77432] [VERBOSE-2:profiler_metrics_ios.mm(184)] Error retrieving thread information: (ipc/send) invalid destination port
I bother this part "App with name __FIRAPP_DEFAULT does not exist."
GoogleService-info.plist and info.plist are perfect. When I made an ios app in firebase, I couldn't do the same with the flutter package name. Because when setting up the flutter android project. I put it underscore in the name and this worked fine. However, the ios app was made differently because underscore is prohibited when you put the package name.
the weird thing is it is keep showing only white screen
So my question is if android flutter name and ios flutter name are different, will this be a problem in firebase?
Yes both the package name different in Android & ios will work fine in firebase , because Android and ios will have different GoogleService and GoogleService Info.plist

Flutter: Missing Plugin Exception Raised when running release builds of android app

Issue
I am currently working on an app which uses multiple packages.
The app works like a charm in both debug and profile modes. But when I get the release build and run it, some features do not work.
The reason is a couple of the plugins are not working as intended. This is what I get in the debug console :
E/flutter (14180): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
E/flutter (14180):
E/flutter (14180): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getAll on channel plugins.flutter.io/shared_preferences)
Another case during the same run
E/flutter (14180): [ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: MissingPluginException(No implementation found for method getStorageDirectory on channel plugins.flutter.io/path_provider)
E/flutter (14180): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:157)
E/flutter (14180): <asynchronous suspension>
E/flutter (14180): #1 getExternalStorageDirectory (package:path_provider/path_provider.dart:120)
E/flutter (14180): <asynchronous suspension>
E/flutter (14180): #2 ChatScreenState._init (package:pryzcrybdoctor/Screens/Chats/chat.dart:716)
E/flutter (14180): <asynchronous suspension>
E/flutter (14180): #3 ChatScreenState._prepare (package:pryzcrybdoctor/Screens/Chats/chat.dart:736)
E/flutter (14180): <asynchronous suspension>
I have not used path_provider in my app, it is a transitive dep from a plugin cached_network_image
I got the same exception with permission_handler plugin in this same app, but I removed it to check if permission handler was the issue, but now I can't access camera.
The thing that gets me confused is that all these issues only arise in the release mode. Everything works perfectly in debug and release.
Some weird things I noticed...
It seems that some plugin or plugins are still using the "non AndroidX" support libraries. This is because I have to go through the "build debug then build profile and finally then release" cycle to get the release version built. I've read once that this is when Jetifier is working on some plugins that have not fully migrated. So my best guess is that the issue is with some plugin not fully migrated.
What I have tried so far..
Rebuilding the app multiple times.
flutter clean and then flutter build
flutter pub upgrade
Build using android studio.
Migrate to AndroidX using android studio.
Please let me know if you need more info or logs. Thank you for your time.
Got the solution to this issue from a Flutter GitHub issue.
Just keeping androidx.lifecycle.DefaultLifecycleObserver is enough.
Add the below line to app/proguard-rules.pro:
-keep class androidx.lifecycle.DefaultLifecycleObserver

Categories

Resources