FATAL EXCEPTION: TokenRefresher - flutter

i have getting following error 2 time, i have tried all thing but i have no solution how this error is occured.
FATAL EXCEPTION: TokenRefresher
E/AndroidRuntime( 370): Process: com.deligence.collectivegiving, PID: 370
E/AndroidRuntime( 370): java.lang.NoSuchFieldError: No field PREFER_HIGHEST_OR_REMOTE_VERSION_NO_FORCE_STAGING of type Lcom/google/android/gms/dynamite/DynamiteModule$VersionPolicy; in class Lcom/google/android/gms/dynamite/DynamiteModule; or its superclasses (declaration of 'com.google.android.gms.dynamite.DynamiteModule' appears in /data/app/com.deligence.collectivegiving-jOzmRflbUyduL_1oLQGcBQ==/base.apk!classes2.dex)

I imagine you're using Firebase services by the exception (maybe..). I had the same problem few days ago and resolved updating to these versions (I don't know which service you're using):
firebase_analytics: 1.0.4
firebase_auth: 0.6.2+1
firebase_database: ^1.0.5
firebase_storage: 1.0.4
firebase: ^5.0.2
Hope it helps.

Related

Firebase deployed flutter web page throws exception (since today) - why?

I have a flutter web app with the following dependencies, updated today to most recent ones. There was no code change! Just version updates:
firebase_storage: ^11.0.12
firebase_core: ^2.6.0
cloud_firestore: ^4.4.1
firebase_auth: ^4.2.7
Running the web app locally works fine (Chrome), but when I upload/deploy it to firebase, I get the following Exception:
VM155:2 Uncaught (in promise) TypeError: Failed to resolve module specifier 'Instance of 'TrustedScriptURL''
at window.ff_trigger_firebase_core (<anonymous>:2:18)
at mJ.v7 (main.dart.js:49235:19)
at main.dart.js:52258:9
at aJx.a (main.dart.js:6218:62)
at aJx.$2 (main.dart.js:45146:14)
at Object.M (main.dart.js:6204:10)
at ag6.aqG (main.dart.js:52262:10)
at ag6.BK (main.dart.js:52239:21)
at ag8.$1 (main.dart.js:52332:15)
at e9.q (main.dart.js:44287:19)
which is this statement
and the same exceptions for all other firebase packages:
The problem is, when I now revert back to the old firebase version, the problem stays! I donĀ“t know what happened. Edge browser shows the same exception.
Thanks!

.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-1.0.7/lib/src/internals.dart:10:20: Error: Method not found: 'guard'. return internals.guard(

I'm new to flutter, So far yesterday I was working on a project everything was fine, But from yesterday this error is showing but I din'nt change anything in the code.
The error
/D:/flutter_sdk/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore_web-1.0.7/lib/src/internals.dart:10:20: Error: Method not found: 'guard'.
return internals.guard(
firebase_messaging: ^11.2.8
cloud_firestore: ^3.1.10
firebase_core: ^1.13.1

Flutter app running on web failing with error:

**/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_web-2.2.8/lib/src/internals.dart:11:10:
Error: Method not found: 'guardWebExceptions'. return
internals.guardWebExceptions(
^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:13:11:
Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(exception, stackTrace);
^^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:16:9:
Error: Method not found: 'Error.throwWithStackTrace'.
Error.throwWithStackTrace(
^^^^^^^^^^^^^^^^^^^
/C:/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_messaging_platform_interface-3.2.0/lib/src/method_channel/utils/exception.dart:11:7:
Error: A non-null value must be returned since the return type 'Never'
doesn't allow null. Never convertPlatformException(Object exception,
StackTrace stackTrace) {
^ Failed to compile application.**
I found a solution for this.
I added it to my pubspeck.yaml:
dependency_overrides:
firebase_messaging_platform_interface: 3.1.6
Have a good day :)
There were changes made to the dependencies of the Flutter Firebase packages
https://github.com/FirebaseExtended/flutterfire/pull/8156
You can either update to use 2.16.0 version of dart or newer.
Or override the dependencies, you only need to add the ones that you are using
dependency_overrides:
firebase_messaging_platform_interface: 3.1.6
firebase_storage_platform_interface: 4.0.14
cloud_functions_platform_interface: 5.0.21
cloud_firestore_platform_interface: 5.4.13
firebase_auth_platform_interface: 6.1.11
firebase_database_platform_interface: 0.2.0+5
As pointed out earlier by GarrettBarlocker, dependency overrides of all the firebase dependencies used in my project did the trick for me and it solved the problem.
Don't try flutter upgrade as it upgrades your project to the latest version of the flutter release. And it will force you to migrate your project to android v2 embedding as v1 embedding is deprecated in flutter 2.10.2 thereby failing to compile and build the application. Also, you may face compatibility issues with other dependencies.
I have faced the same problem and got a workaround for this.
override firebase_messaging_platform_interface in pubspeck.yaml:
dependency_overrides:
firebase_messaging_platform_interface: 3.1.6
check ref: https://github.com/FirebaseExtended/flutterfire/issues/8181
remove the firebase ^9.0.2 from the pubspec.yaml file
because this partucular one is for Web apps and you're trying to build an android app

in_app_purchase Package flutter

I use in_app_purchase: ^0.2.1 Package for flutter. When I start the purchase I get this Error:
Unhandled Exception: PlatformException(error, Unable to find explicit activity class {com.www.x.xx/com.android.billingclient.api.ProxyBillingActivity}; have you declared this activity in your AndroidManifest.xml?, null)
The Activity isnt defined in the manifest..
https://pub.dev/packages/in_app_purchase#-readme-tab-
This is the Plugin!
I have used Flutter Clean and now it works I dont know why.

java.lang.NoSuchMethodError: com.vungle.warren.Vungle.updateConsentStatus after updating to latest Vungle SDK

I am using Vungle ad network via MoPub SDK for showing ads in Android Application. I have just updated the Vungle SDK to latest as per their changelog (version 6.3.12). Now the app is crashing. The exception is as below:
08-03 16:56:58.480 14071-14071/com.globaldelight.vizmato E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.globaldelight.vizmato, PID: 14071
java.lang.NoSuchMethodError: com.vungle.warren.Vungle.updateConsentStatus
at com.mopub.mobileads.VungleRouter$2.onSuccess(VungleRouter.java:85)
at com.vungle.warren.Vungle$2.onResponse(Vungle.java:479)
at com.vungle.warren.network.VungleApiClient$4.onResponse(VungleApiClient.java:514)
at retrofit2.ExecutorCallAdapterFactory$ExecutorCallbackCall$1$1.run(ExecutorCallAdapterFactory.java:68)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5333)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
at dalvik.system.NativeStart.main(Native Method)
Could someone please help me solve this issue?
Thanks in advance.