最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

android - Flutter build apk throws: Exception: AOT snapshotter exited with code -1073741819 - Stack Overflow

programmeradmin3浏览0评论

The Flutter build is failing and throwing an AOT (Ahead-of-Time) Exception during compilation. Initially, I had upgraded Flutter to the latest stable version 3.29.2, and at that time, the build process worked without issues. However, now, even after trying to build with the same Flutter version, the issue persists. I have already attempted cleaning the project using flutter clean, deleting the .dart_tool and build directories, and even running flutter pub get, but none of these steps have resolved the problem.

If anyone has faced a similar issue or knows a potential fix, please share your insights.

PS D:\AndroidStudiosProjects\nccs_projects\nccs_pos> flutter build apk
Dart snapshot generator failed with exit code -1073741819
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 7160 bytes (99.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073741819


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'D:\Program Files\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .

BUILD FAILED in 11s
Running Gradle task 'assembleRelease'...                           12.3s
Gradle task assembleRelease failed with exit code 1

Tried with --no-tree-shake

PS D:\AndroidStudiosProjects\nccs_projects\nccs_pos> flutter build apk --no-tree-shake-icons
Dart snapshot generator failed with exit code -1073741819
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 7160 bytes (99.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073741819


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'D:\Program Files\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at .

BUILD FAILED in 11s
Running Gradle task 'assembleRelease'...                           12.3s
Gradle task assembleRelease failed with exit code 1

Flutter doctor history:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.29.2, on Microsoft Windows [Version 10.0.26100.3476], locale en-US)
[√] Windows Version (Windows 11 or higher, 24H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at /.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2024.2)
[√] Android Studio (version 2024.3)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

The Flutter build is failing and throwing an AOT (Ahead-of-Time) Exception during compilation. Initially, I had upgraded Flutter to the latest stable version 3.29.2, and at that time, the build process worked without issues. However, now, even after trying to build with the same Flutter version, the issue persists. I have already attempted cleaning the project using flutter clean, deleting the .dart_tool and build directories, and even running flutter pub get, but none of these steps have resolved the problem.

If anyone has faced a similar issue or knows a potential fix, please share your insights.

PS D:\AndroidStudiosProjects\nccs_projects\nccs_pos> flutter build apk
Dart snapshot generator failed with exit code -1073741819
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 7160 bytes (99.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073741819


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'D:\Program Files\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle..

BUILD FAILED in 11s
Running Gradle task 'assembleRelease'...                           12.3s
Gradle task assembleRelease failed with exit code 1

Tried with --no-tree-shake

PS D:\AndroidStudiosProjects\nccs_projects\nccs_pos> flutter build apk --no-tree-shake-icons
Dart snapshot generator failed with exit code -1073741819
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 7160 bytes (99.6% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073741819


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'D:\Program Files\flutter\bin\flutter.bat'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle..

BUILD FAILED in 11s
Running Gradle task 'assembleRelease'...                           12.3s
Gradle task assembleRelease failed with exit code 1

Flutter doctor history:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.29.2, on Microsoft Windows [Version 10.0.26100.3476], locale en-US)
[√] Windows Version (Windows 11 or higher, 24H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 36.0.0)
[√] Chrome - develop for the web
[X] Visual Studio - develop Windows apps
    X Visual Studio not installed; this is necessary to develop Windows apps.
      Download at https://visualstudio.microsoft/downloads/.
      Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2024.2)
[√] Android Studio (version 2024.3)
[√] Connected device (4 available)
[√] Network resources

! Doctor found issues in 1 category.

Share Improve this question asked Mar 18 at 8:23 Peaky ProdigyPeaky Prodigy 838 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

Try to change version path : android/build.gradle(project level gradle file)

classpath 'com.android.tools.build:gradle:8.0.0'

Check also this gradle-wrapper.properties:

distributionUrl=https\://services.gradle./distributions/gradle-7.6.3-all.zip

Make sure to clean all generated files before make new build.

发布评论

评论列表(0)

  1. 暂无评论