Search code examples
androidflutterout-of-memory

Error: ../../runtime/vm/zone.cc: 96: error: Out of memory flutter and VisualStudio


When i try to run my flutter project on VisualStudio, i have this error:


v
ersion=2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "windows_x64"
pid=21740, thread=9520, isolate_group=main(000002143A8F4EA0), isolate=(nil)(0000000000000000)
isolate_instructions=21439460000, vm_instructions=7ff7622366e0


 pc 0x00007ff762440202 fp 0x000000f7da1fdb10 Dart_IsPrecompiledRuntime+0x21ef62
-- End of DumpStackTrace
../../runtime/vm/zone.cc: 96: error: Out of memory.
Aborting re-entrant request for stack trace.

../../runtime/vm/zone.cc: 96: error: Out of memory.
version=2.18.6 (stable) (Tue Dec 13 21:15:14 2022 +0000) on "windows_x64"
pid=4772, thread=5316, isolate_group=main(000002AD3588A0C0), isolate=(nil)(0000000000000000)
isolate_instructions=7ff7622366d0, vm_instructions=7ff7622366e0
  pc 0x00007ff762440202 fp 0x000000da680fdff0 Dart_IsPrecompiledRuntime+0x21ef62
-- End of DumpStackTrace
=== Crash occured when compiling dart:core_RegExp__matcher in optimizing JIT mode in TypePropagation pass
../../runtime/vm/zone.cc: 96: error: Out of memory.
Aborting re-entrant request for stack trace.

I am not using emulator, and this is AndroidManifest.xml:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.mypocket">
    <!-- The INTERNET permission is required for development. Specifically,
         the Flutter tool needs it to communicate with the running application
         to allow setting breakpoints, to provide hot reload, etc.
    -->
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <application android:allowBackup="false"></application>
</manifest>

Please help, i don't know what to do!!


Solution

  • Please add in to your activity class into manifest file

     <activity
                android:name=".MainActivity"
                android:allowBackup="false"
                android:exported="true"
                android:fullBackupOnly="false" //add this line
                android:hardwareAccelerated="true" // add this line
                android:launchMode="singleTop"
                android:screenOrientation="portrait"
                android:theme="@style/Theme.AppCompat.Light"
                android:windowSoftInputMode="adjustResize">