Always getting this error on a project without any reason for the moment could you help me on this.
Undefined name 'ScaffoldMessenger'.
Try correcting the name to one that is defined, or defining the name.
Flutter version : 1.22.5 stable
Could you help me on this please ?
Got the same error and I tried this and it work
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text('Some Text'),
),
);
If you are still experiencing this issue you might have to update your Flutter sdk.
ScaffoldMessenger was first released to Flutter stable channel the 3th of March 2021...
To update flutter just run
flutter upgrade
on your terminal/command line.
For further details take a look at the ScaffoldMessenger documentation or in StackOverflow see this thread.
According to https://flutter.dev/docs/release/breaking-changes (at the moment), under Not yet released to stable, we see SnackBars managed by the ScaffoldMessenger. So, it's not in 1.22... it'll be in the next release.
If you get an error that scaffold is not present then, use builder widget to get the context and then use the scaffold.of() part.
Related
Am currently trying to setup notifications on my managed expo project
Expo version 47.0.0
Expo notifications version 0.17.0
Device: Samsung Galaxy s10
Android version 12
I am currently just trying to get the basic setup itself working and retrieve my devices push token. This should be done using Notifications.getExpoPushTokenAsync() as described here.
The Problem
My error is strange, when I call getExpoPushTokenAsync it does indeed get me the expo push token, however shortly after my app crashes with the following messages
ERROR TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[1], "../../../src/util").types.isPromise')
WARN [expo-notifications] Error encountered while updating server registration with latest device push token. [TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[5], "#ide/backoff").computeNextBackoffInterval')]
I have tried
re-installing node_modules and expo-notifications but still get the same.
I can definitely see the #ide/backoff package is installed in my node_modules.
I also followed these instructions to setup firebase in app, even though my understanding is that it should work out of the box in expo go app while devving.
One other interesting thing is that I can call Notifications.getDevicePushTokenAsync() fine with no error. But still get the same error if i pass that in to getExpoPushTokenAsync method after. At a surface level it seems like somehow the request out to expo services to get the expo push token is both passing and failing 🤷♂️
const devicePushTokenResponse = await Notifications.getDevicePushTokenAsync();
const expoPushTokenResponse = await Notifications.getExpoPushTokenAsync({
devicePushToken: devicePushTokenResponse,
}); // <--- Returns token & errors a few seconds later
Couldn't see any other posts with this error and expo-notifications, so would be keen to see if anyone else has ran into / fixed a similar issue recently
Cheers
Alright I figured it out, it was somewhat hinted at by this line
ERROR TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[1], "../../../src/util").types.isPromise')
And more specifically the fact that a node_modules dependency is referencing 3 levels up in the file system.
The solution
Turns out that for some reason my module resolver (defined in babel.config.js) was resolving my project's util folder instead of the packages util folder. I think this was compounded by my metro config making use of the inlineRequires functionality to improve performance (see more)
I am sure there is some actual config that could be updated to exclude node_modules from using inline requires (i did try use a blocklist to no avail), but as an interim, i was able to get it working fine by changing the path of my util folder to be #my-project/util so that it avoids future collisions.
Hope this helps anyone who runs into the same issue in the future :)
Im Using Here SDK for Flutter. Now with the Flutter 3.0 update it broke.
I tried to change the null aware operators inside that package and the
plugins/here_sdk/lib/src/sdk/mapview/here_map.dart
---> No more errors.
inside
plugins/here_sdk/android/src/main/kotlin/com/here/mapview/MapController.kt
line 52
plugin.registrar!!.activity().application.registerActivityLifecycleCallbacks(this)
changed to:
plugin.registrar!!.activity()!.application.registerActivityLifecycleCallbacks(this)
line 114:
plugin.registrar!!.activity().application.unregisterActivityLifecycleCallbacks(this)
changed to :
plugin.registrar!!.activity()!.application.unregisterActivityLifecycleCallbacks(this)
Now the maps Builds but is in some kind of between state. There is no error and the map is not controllable.
---> Rest of my UI doesn't build.
Should i wait for the Offical update or stay with Flutter 2.10.5 ?
As told in comment the we are not supporting the Flutter 3.
Please check the minimum-requirements for the HERE SDK flutter.
since 4.12.7 you actually do. Forgot to answer.
https://developer.here.com/documentation/flutter-sdk-navigate/4.12.7.0/dev_guide/topics/about.html
I have a Xamarin for Android app that has been working until today. I needed to make a change but before I did, I ran a test to ensure no VS or Nuget package updates caused an issue. I have Xamarin.Essentials in my app and this line worked before, not sure what is happening now.
if(DeviceInfo.Model == "TC72"){scannerIndex = 1;}
Exception Unhandled:
Xamarin.Essentials.NotImplementedInReferenceAssemblyException: 'This
functionality is not implemented in the portable version of this
assembly. You should reference the NuGet package from your main
application project in order to reference the platform-specific
implementation.'
Any insight would be helpful. TIA
I changed the DeviceInfo.Model to Build.Model and get the same info I was expecting. That fixed my issue. If anyone has a different suggestion, happy to entertain them.
Added 8/11/21 3:25pm CT
I also found that changing my Compile Target to 10.0 fixed the Xamarin.Essentials issues. So far the application is working on 8.1 on the device (Zebra MC3300).
Received this error
Could not set unknown property 'debugSymbolLevel' for object of type
com.android.build.gradle.internal.dsl.NdkOptions.
when I ran flutter build appbundle into the terminal. I'm new to Android Studio and using the Flutter Sdk, and I don't really know what to do. If you've run into similar problems, it'd be helpful if you put down what worked for you, thanks!
I'm developing an app for android using openfl. I could successfully compile for android before trying to use HxScout.
But following instructions on hxscout.com, when I try to test my app with this command:
haxelib run lime test android -Dtelemetry
I get the following error:
./src/hxtelemetry/CppHxTelemetry.cpp:233: error: return-statement with no value, in function returning 'Void'
I just pushed the fix to both git and haxelib (hxtelemetry v0.3.5). I think there were issues with different versions of haxe/hxcpp wanting different styles of returns.
Anyway, LMK if it doesn't work.
Fixed in this issue here on github