My app was working perfectly and suddenly it started showing me compiler error. Here is the error:
Compiler message:
org-dartlang-debug:synthetic_debug_expression:1:1: Error: Method not found: 'toStringDeep'.
toStringDeep()
^^^^^^^^^^^^
org-dartlang-debug:synthetic_debug_expression:1:1: Error: The method 'toStringDeep' isn't defined for the class 'NumberFormat'.
- 'NumberFormat' is from 'package:intl/intl.dart' ('file:///Users/chandra/flutter/.pub-cache/hosted/pub.dartlang.org/intl-0.15.7/lib/intl.dart').
Try correcting the name to the name of an existing method, or defining a method named 'toStringDeep'.
toStringDeep()
This is a known bug 36091 and 30381 which should be fixed in the next release. The only workaround is to run flutter clean. (Using Android Studios Tools -> Flutter -> Flutter Clean should also work).
It is a hassle to do this every time so I saved it default config which works for any Flutter run.
Run --> Edit Configurations
Select Flutter and then add new configuration of external tool like
Next create tool as shown
Make sure our external tool is checked
Finally, you should have something like
Hit ok and done!!!
Now every time you run a Flutter app, it will clean the build first.
Related
I was debugging my project. After some execution, it started showing an error saying that the Dart compiler exited unexpectedly (see screenshot below). I also updated my dart SDK, but nothing happened. I did search on Google, but found nothing that helped.
try this may help
flutter clean
This issue could also happen when you have migrated to Null-Safety. The reason is that when migrating to Null-Safety, all packages need to also be migrated to Null-Safety, thus it will return an error saying:
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
Also, it will give you a link for you to reference:
For solutions, see https://dart.dev/go/unsound-null-safety
Unhandled exception:
Bad state: Unsupported Null Safety mode NonNullableByDefaultCompiledMode.Invalid, in null.
Since this issue results in an error, you won't be able to run your project or package unless all packages in your dependencies are null-safety migrated. The dart compiler will end after this.
the Dart compiler exited unexpectedly.
Failed to compile application.
Exited (sigterm)
If you get the issue and you are sure that all packages are up-to-date and that all support Null-Safety, try running flutter clean. This will clear or packages in your project and reinstall them, cache files will also be removed.
Please leave down a comment if you may have any suggestions, or edit this answer if you wish.
I had this problem after adding package golden_toolkit and one golden test I wrote for it. Removing the test file and the dependency from pubspec.yaml and then running flutter clean, flutter pub get fixed it.
In my case flutter clean cant help. My flutter/bin/cache folder was corrupted. Deleting flutter/bin/cache folder and then running command flutter, downloads dart SDK and then setting up the flutter sdk path by giving your flutter folder path in Android Studio -> Preferences -> Languages and Frameworks -> Flutter , solves my problem.
delete flutter/bin/cache then type in terminal flutter clean then flutter run
that's work for me
My case was really strange and I don't know were it comes from, is it VS or Dart
The point is somewhere here where I set my class as the generic of the base class: class MyClass extends MyBaseClass<MyClass> and add an instance to the VS WATCH and set a beark point after the instance creation.
class MyBaseClass<T> {}
class MyClass extends MyBaseClass<MyClass> {
#override
String toString() => "MyClassObject";
}
main() {
MyClass o = MyClass();
print(o); // If you add 'o' to your WATCH items and add a breakpoint here it will crash
}
if you add any packages it can be the problem.
just use
flutter clean
flutter pub get
flutter run
Trying to create a NEW project which targets -both- macos and ios/android seems to fail.
Steps:
Followed steps on react native website, using create-react-native-app to get a native application. It works fine.
Use react-native-macos init and macos to get the mac app - it also works fine.
Noticing that #1 uses an App.js and #2 uses some sort of index.platform.js model, I change the xcode project in #2 to look for App.js instead. This at least makes sure the same code is reached.
As the react-native-macos github page says to do, I merge #2 into #1.. (unclear whether should overwriting, used 'ditto' command)
Add the rn-cli.config.js file to root, as react-native-macos says to do
Missing modules when I try to run macos - fails to bundle.
It looks to me like the 'react-native' folder in the node modules is somehow screwing up the react-native-macos folder. I'm still trying a variety of things but it's been exhausting considering how easy 'merge into your existing project' sounds.
https://github.com/ptmt/react-native-macos <- what i want to merge in
You likely will not be able to use create-react-native-app and react-native-macos together without some trail and error. This is because create-react-native-app actually creates an Expo app which is built on top of react-native but tries to abstract away a lot of the native details from the end user. For example you can't use any native modules that are not shipped with Expo when using create-react-native-app. The documentation of react-native-macos is likely assuming you are using react-native init which creates a base react-native project that you have to handle building on your own instead of offloading the build process to Expo.
I am trying to port QT5 application to iOS. It builds and runs fine with QtCreator, but now I am trying to make manual XCode project. Next steps are gatheres from another topics, here is my final path:
It builds and runs, but I got runtime error:
Error: You are creating QApplication before calling UIApplicationMain.
I've found, that I should replace main -> qtmn, but then I got error about no entry point.
The declaration of main is inside of libqios.a, but I am unable to tell linker "Take main() from libqios, not from cpp files."
I tried it with
-Wl,-force_load,$(QT_SDK)/plugins/platforms/libqios.a - but it does nothing.
I found, that QT preprocessor makes something with object files (renaming main into something others), but it looks too horrible. How can it be solved?
Succeeded in by: renaming main -> qtmn (in qt sourced), rebuilt QT, and called qt_main_wrapper from my main().
I was really excited, when JetBrains launched the Project Rider-EAP. First thing I've tried was to get a Xamarin-iOS project to run in Rider-EAP, but it doesn't work out of the box.
Update 1: This issue is now listed as critical bug with fix in EAP 2: https://youtrack.jetbrains.com/issue/RIDER-618
1. Problem (fixed) Projects didn't load with the exception that Xamarin.iOS.targets could not be found.
I fixed this with a simple Symlink:
ln -s /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/ “/Applications/Rider EAP.app/Contents/lib/ReSharperHost/macos-x64/mono/lib/mono/xbuild/”
2. Problem
References are not loaded correctly. Therefore the whole syntax highlighting and everything beyond is broken.
See screenshot: References are not loaded correctly
I get the following error as well:
Error:null: Error initializing task MakeDir: Could not load file or assembly '/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS/Xamarin.iOS.Tasks.dll' or one of its dependencies
Switching the xbuild to mono 4.2.2 removes the error but not solves the problem.
PS: It seams that the references are loaded correctly for Xamarin Android projects.
Basic Xamarin Support like open and build is added with EAP 8 of Project Rider.
More advanced features will come with the next Builds and are tracked here: https://youtrack.jetbrains.com/issue/RIDER-1533
I recently downloaded the trial version of Mono For Android. I tried running the Hello World tutorial. I receive the following error:
Tried to launch activity 'HelloMonoDroid.HelloMonoDroid/hellomonodroid.Activity1', but the device could not find it.
A common cause of this is manually adding an to your AndroidManifest.xml whose name does not match your Activity class.
Consider using the [Activity] attribute instead:
http://monodroid.net/Tutorials/Working_with_AndroidManifest.xml
I triple checked my code and didn't see any differences between it and the posted code in the tutorial. So I tried to create a new Mono For Android Project and ran it without modification. I named the Project Driver. Here is the error I received:
Tried to launch activity 'Driver.Driver/driver.Activity1', but the device could not find it.
A common cause of this is manually adding an to your AndroidManifest.xml whose name does not match your Activity class.
Consider using the [Activity] attribute instead:
http://monodroid.net/Tutorials/Working_with_AndroidManifest.xml
Notice it is the same as the original error with only the activity name changed. This is a simple solution. I am not creating a AndroidManifest.xml file manually. Is this a bug with the Mono For Android product?
Go to Tools->Options->Mono for Android and turn on adb logging.
This should write a log to your desktop that might give more details.
Aha, thanks I've found the issue. There is a place in that dialog (Tools->Options->Mono For Android) that sets the Android SDK path. After doing this the solution deploys and works with no trouble. I thought I told the installer where the SDK was, but apparently not. Its possible I got myself confused as I'm evaluating the Eclipse/Android SDK development environment in parrallel.