Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter AOT precompiler crash using isar package. #97301

Closed
anandsubbu007 opened this issue Jan 26, 2022 · 12 comments
Closed

Flutter AOT precompiler crash using isar package. #97301

anandsubbu007 opened this issue Jan 26, 2022 · 12 comments
Assignees
Labels
a: build Building flutter applications with the tool c: crash Stack traces logged to the console dependency: dart Dart team may need to help us found in release: 2.10 Found to occur in 2.10 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@anandsubbu007
Copy link

Mostly related to this issue: #80902 (comment)

flutter build apk

 Building with sound null safety 

../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3298: error: unreachable code
Dart snapshot generator failed with exit code -1073740791


FAILURE: Build failed with an exception.

* Where:
Script 'C:\My Program Setup\Flutter Components\Flutter Dev\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command 'C:\My Program Setup\Flutter Components\Flutter Dev\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.org

BUILD FAILED in 3m 47s
Running Gradle task 'assembleRelease'...                          231.7s
Gradle task assembleRelease failed with exit code 1

flutter doctor -v

[√] Flutter (Channel beta, 2.10.0-0.2.pre, on Microsoft Windows [Version 10.0.19043.1466], locale en-IN)
    • Flutter version 2.10.0-0.2.pre at C:\My Program Setup\Flutter Components\Flutter Dev\flutter      
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 73adb1406a (7 days ago), 2022-01-19 17:02:56 -0600
    • Engine revision 74b74b10ea
    • Dart version 2.16.0 (build 2.16.0-134.1.beta)
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)        
    • Android SDK at C:\Users\anand\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\My Program Setup\Flutter Components\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)       
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.6)      
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31829.152
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 3.6)
    • Android Studio at C:\My Program Setup\Flutter Components\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code (version 1.63.2)
    • VS Code at C:\Users\anand\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.32.0

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19043.1466]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 96.0.4664.110
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 97.0.1072.69

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

flutter build apk --release --verbose

[ +229 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +220 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +2 ms] 73adb1406a9cff796e2203ad16fd285220a6ec97
[   +1 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git tag --points-at 73adb1406a9cff796e2203ad16fd285220a6ec97        
[ +384 ms] Exit code 0 from: git tag --points-at 73adb1406a9cff796e2203ad16fd285220a6ec97
[        ] 2.10.0-0.2.pre
[  +20 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +104 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[   +3 ms] origin/beta
[        ] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git ls-remote --get-url origin
[  +94 ms] Exit code 0 from: git ls-remote --get-url origin
[   +1 ms] https://github.com/flutter/flutter.git
[ +352 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref HEAD
[ +136 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +1 ms] beta
[ +174 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[  +48 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[  +28 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[  +25 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[  +14 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +203 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[   +6 ms] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[  +40 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +3 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[  +16 ms] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +2 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +436 ms] Skipping pub get: version match.
[ +109 ms] Found plugin window_size at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\git\flutter-desktop-embedding-fd519be1e8398c6b6c2062c2447bac960a71bc02\plugins\window_size\
[ +133 ms] Found plugin cloud_firestore at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-3.1.6\
[  +11 ms] Found plugin cloud_firestore_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore_web-2.6.6\
[ +101 ms] Found plugin desktop_window at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\desktop_window-0.4.0\
[  +58 ms] Found plugin file_picker at C:\My Program Setup\Flutter Components\Flutter Dev\flutter\.pub-cache\hosted\pub.dartlang.org\file_picker-4.3.2\
[  +38 ms] Found plugin firebase_core at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-1.11.0\
[   +6 ms] Found plugin firebase_core_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core_web-1.5.3\
[  +59 ms] Found plugin flutter_background at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_background-1.1.0\
[  +15 ms] Found plugin flutter_plugin_android_lifecycle at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-2.0.5\
[  +78 ms] Found plugin image_picker at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.8.4+5\
[   +5 ms] Found plugin image_picker_for_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker_for_web-2.1.5\
[  +23 ms] Found plugin isar_flutter_libs at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\isar_flutter_libs-1.0.5\
[  +38 ms] Found plugin path_provider at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.8\
[   +5 ms] Found plugin path_provider_android at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.11\
[  +17 ms] Found plugin path_provider_ios at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.7\
[   +3 ms] Found plugin path_provider_linux at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.5\
[   +6 ms] Found plugin path_provider_macos at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.5\
[  +10 ms] Found plugin path_provider_windows at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.5\
[  +17 ms] Found plugin printing at C:\My Program Setup\Flutter Components\Flutter Dev\flutter\.pub-cache\hosted\pub.dartlang.org\printing-5.6.6\
[  +59 ms] Found plugin url_launcher at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-6.0.18\
[   +5 ms] Found plugin url_launcher_android at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_android-6.0.14\
[   +3 ms] Found plugin url_launcher_ios at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_ios-6.0.14\
[   +3 ms] Found plugin url_launcher_linux at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_linux-2.0.3\
[   +4 ms] Found plugin url_launcher_macos at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_macos-2.0.3\
[   +6 ms] Found plugin url_launcher_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_web-2.0.6\
[  +17 ms] Found plugin url_launcher_windows at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_windows-2.0.2\
[ +132 ms] Found plugin window_size at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\git\flutter-desktop-embedding-fd519be1e8398c6b6c2062c2447bac960a71bc02\plugins\window_size\
[  +66 ms] Found plugin cloud_firestore at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore-3.1.6\
[  +12 ms] Found plugin cloud_firestore_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\cloud_firestore_web-2.6.6\
[  +23 ms] Found plugin desktop_window at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\desktop_window-0.4.0\
[  +26 ms] Found plugin file_picker at C:\My Program Setup\Flutter Components\Flutter Dev\flutter\.pub-cache\hosted\pub.dartlang.org\file_picker-4.3.2\
[   +3 ms] Found plugin firebase_core at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-1.11.0\
[   +5 ms] Found plugin firebase_core_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core_web-1.5.3\
[   +9 ms] Found plugin flutter_background at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_background-1.1.0\
[   +3 ms] Found plugin flutter_plugin_android_lifecycle at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-2.0.5\
[  +29 ms] Found plugin image_picker at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker-0.8.4+5\
[   +3 ms] Found plugin image_picker_for_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\image_picker_for_web-2.1.5\
[   +9 ms] Found plugin isar_flutter_libs at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\isar_flutter_libs-1.0.5\
[  +22 ms] Found plugin path_provider at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.8\
[   +3 ms] Found plugin path_provider_android at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.11\
[   +6 ms] Found plugin path_provider_ios at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.7\
[   +8 ms] Found plugin path_provider_linux at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.5\
[   +9 ms] Found plugin path_provider_macos at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.5\
[   +8 ms] Found plugin path_provider_windows at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.5\
[  +20 ms] Found plugin printing at C:\My Program Setup\Flutter Components\Flutter Dev\flutter\.pub-cache\hosted\pub.dartlang.org\printing-5.6.6\
[  +44 ms] Found plugin url_launcher at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher-6.0.18\
[   +3 ms] Found plugin url_launcher_android at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_android-6.0.14\
[   +3 ms] Found plugin url_launcher_ios at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_ios-6.0.14\
[   +3 ms] Found plugin url_launcher_linux at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_linux-2.0.3\
[   +3 ms] Found plugin url_launcher_macos at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_macos-2.0.3\
[   +8 ms] Found plugin url_launcher_web at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_web-2.0.6\
[   +3 ms] Found plugin url_launcher_windows at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\url_launcher_windows-2.0.2\
[  +59 ms] Generating C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +332 ms]  Building with sound null safety 
[  +70 ms] Running Gradle task 'assembleRelease'...
[  +27 ms] Using gradle from C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\android\gradlew.bat.
[  +46 ms] executing: C:\My Program Setup\Flutter Components\Android Studio\jre\bin\java -version
[ +242 ms] Exit code 0 from: C:\My Program Setup\Flutter Components\Android Studio\jre\bin\java -version
[   +1 ms] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
           OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
[   +6 ms] executing: [C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\android/] C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\android\gradlew.bat-Pverbose=true -Ptarget-platform=android-arm,android-arm64,android-x64 -Ptarget=lib\main.dart -Pbase-application-name=android.app.Application
-Pdart-obfuscation=false -Ptrack-widget-creation=true -Ptree-shake-icons=true assembleRelease
[+3798 ms] > Configure project :app
[   +4 ms] WARNING: The option setting 'android.enableR8=true' is deprecated.
[   +3 ms] It will be removed in version 5.0 of the Android Gradle plugin.
[  +27 ms] You will no longer be able to disable R8
[+3232 ms] > Task :app:compileFlutterBuildRelease
[   +2 ms] [ +265 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[  +38 ms] [ +237 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +49 ms] [        ] 73adb1406a9cff796e2203ad16fd285220a6ec97
[  +58 ms] [   +1 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git tag --points-at
73adb1406a9cff796e2203ad16fd285220a6ec97
[  +49 ms] [ +115 ms] Exit code 0 from: git tag --points-at 73adb1406a9cff796e2203ad16fd285220a6ec97
[  +78 ms] [        ] 2.10.0-0.2.pre
[ +109 ms] [  +19 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +92 ms] [ +142 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[  +68 ms] [        ] origin/beta
[  +30 ms] [        ] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git ls-remote --get-url origin
[  +31 ms] [ +153 ms] Exit code 0 from: git ls-remote --get-url origin
[  +44 ms] [        ] https://github.com/flutter/flutter.git
[ +184 ms] [ +215 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref HEAD
[ +450 ms] [ +180 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +296 ms] [        ] beta
[ +160 ms] [ +155 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[  +54 ms] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[  +32 ms] [   +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[  +32 ms] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[  +56 ms] [  +16 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[  +36 ms] [   +1 ms] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[  +43 ms] [   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[  +23 ms] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[  +26 ms] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[  +60 ms] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[  +49 ms] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[  +66 ms] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +10 ms] [ +548 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[   +4 ms] [  +14 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +9 ms] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +4 ms] [   +1 ms] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +6 ms] [        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[   +8 ms] [   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +6 ms] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +5 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +4 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[  +14 ms] [   +1 ms] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +6 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +5 ms] [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[   +4 ms] [ +349 ms] Initializing file store
[   +4 ms] [  +90 ms] Done initializing file store
[ +347 ms] [ +868 ms] Skipping target: gen_localizations
[  +94 ms] [  +59 ms] Skipping target: gen_dart_plugin_registrant
[+4713 ms] [+4754 ms] kernel_snapshot: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\lib\Windows\Main.dart}
[ +125 ms] [  +50 ms] C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev C:\My Program
Setup\Flutter Components\Flutter Dev\flutter\bin\cache\artifacts\engine\windows-x64\frontend_server.dart.snapshot --sdk-root C:\My Program Setup\FlutterComponents\Flutter Dev\flutter\bin\cache\artifacts\engine\common\flutter_patched_sdk_product/ --target=flutter --no-print-incremental-dependencies      
-Ddart.vm.profile=false -Ddart.vm.product=true --aot --tfa --packages C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\package_config.json  
--output-dill C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill --depfile
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\kernel_snapshot.d
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\generated_main.dart
[+65152 ms] [+65160 ms] kernel_snapshot: Complete
[ +513 ms] [ +532 ms] android_aot_release_android-arm: Starting due to {}
[   +3 ms] [  +12 ms] executing: C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\bin\cache\artifacts\engine\android-arm-release\windows-x64\gen_snapshot --deterministic --snapshot_kind=app-aot-elf
--elf=C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\armeabi-v7a\app.so --strip
--no-sim-use-hardfp --no-use-integer-division
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill
[   +3 ms] [  +12 ms] invalidated build due to missing files:
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\DOES_NOT_EXIST_RERUN_FOR_WILDCARD618455002
[ +184 ms] [ +236 ms] aot_android_asset_bundle: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill,
InvalidatedReasonKind.inputMissing: The following inputs were missing:
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\DOES_NOT_EXIST_RERUN_FOR_WILDCARD618455002}
[ +200 ms] [ +174 ms] android_aot_release_android-arm64: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated
contents: C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill}
[   +2 ms] [        ] executing: C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\bin\cache\artifacts\engine\android-arm64-release\windows-x64\gen_snapshot --deterministic --snapshot_kind=app-aot-elf
--elf=C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\arm64-v8a\app.so --strip
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill
[  +93 ms] [ +112 ms] android_aot_release_android-x64: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill}
[   +2 ms] [        ] executing: C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\bin\cache\artifacts\engine\android-x64-release\windows-x64\gen_snapshot --deterministic --snapshot_kind=app-aot-elf
--elf=C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\x86_64\app.so --strip
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill
[ +412 ms] [ +348 ms] Manifest contained wildcard assets. Inserting missing file into build graph to force rerun. for more information see #56466.
[ +117 ms] [ +137 ms] Running command: C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\cache\artifacts\engine\windows-x64\const_finder.dart.snapshot --kernel-file
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\app.dill --class-library-uri
package:flutter/src/widgets/icon_data.dart --class-name IconData
[+3918 ms] [+3920 ms] Running font-subset: C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\bin\cache\artifacts\engine\windows-x64\font-subset.exe
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\build\app\intermediates\flutter\release\flutter_assets\packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\font_awesome_flutter-9.2.0\lib\fonts\fa-solid-900.ttf, using codepoints 62785 62101
[ +213 ms] [   +1 ms] Running font-subset: C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\bin\cache\artifacts\engine\windows-x64\font-subset.exe
C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\build\app\intermediates\flutter\release\flutter_assets\fonts/MaterialIcons-Regular.otf C:\My Program  
Setup\Flutter Components\Flutter Dev\flutter\bin\cache\artifacts\material_fonts\MaterialIcons-Regular.otf, using codepoints 58332 57490 57491 57706     
57496 57694 57695 57882 57504 57634 58727 58814 58813 58372 57782 59766 57419 58704 60138 57548 57410 58644 59477 58602 57495 57415 58198 60055 60555   
60385 60426 57911 59319 59232 59571 58442 60144 60228 61349 59204 59281 59290 60076 59029 57689 57857 63501 62754 57411 58537 59203 57647 60334 61728   
61082 63187 58380 63509 58407 59300 57453 57510 58771 62000
[ +697 ms] [ +332 ms] aot_android_asset_bundle: Complete
[+15850 ms] [+16378 ms] ../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3298: error: unreachable code
[ +995 ms] [+1104 ms] Dart snapshot generator failed with exit code -1073740791
[+29191 ms] [+29158 ms] android_aot_release_android-x64: Complete
[ +307 ms] [ +269 ms] android_aot_bundle_release_android-x64: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated
contents: C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\x86_64\app.so}
[  +17 ms] [  +25 ms] android_aot_bundle_release_android-x64: Complete
[ +683 ms] [ +734 ms] android_aot_release_android-arm64: Complete
[ +301 ms] [ +263 ms] android_aot_bundle_release_android-arm64: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated
contents: C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\arm64-v8a\app.so}
[   +3 ms] [  +27 ms] android_aot_bundle_release_android-arm64: Complete
[ +297 ms] [ +220 ms] Persisting file store
[   +1 ms] [  +29 ms] Done persisting file store
[   +1 ms] [  +27 ms] Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073740791
[   +1 ms]            #0      AndroidAot.build (package:flutter_tools/src/build_system/targets/android.dart:257:7)
[   +1 ms]            <asynchronous suspension>
[        ]            #1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:839:9)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #2      Future.wait.<anonymous closure> (dart:async/future.dart:473:21)
[        ]            <asynchronous suspension>
[        ]            #3      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:777:32)
[        ]            <asynchronous suspension>
[        ]            #4      Future.wait.<anonymous closure> (dart:async/future.dart:473:21)
[        ]            <asynchronous suspension>
[        ]            #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:777:32)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #6      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:606:16)
[        ]            <asynchronous suspension>
[   +2 ms]            #7      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:317:32)
[        ]            <asynchronous suspension>
[        ]            #8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[   +1 ms]            <asynchronous suspension>
[        ]            #10     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]            <asynchronous suspension>
[   +1 ms]            #11     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)  
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #13     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[   +1 ms]            <asynchronous suspension>
[        ]            #14     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[        ]            <asynchronous suspension>
[        ]            #15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[   +1 ms]            #16     main (package:flutter_tools/executable.dart:94:3)
[        ]            <asynchronous suspension>
[   +1 ms] [   +6 ms] 
[   +1 ms]            #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[   +2 ms]            #1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:334:7)
[   +3 ms]            <asynchronous suspension>
[        ]            #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
[        ]            <asynchronous suspension>
[        ]            #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]            <asynchronous suspension>
[   +2 ms]            #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)  
[   +1 ms]            <asynchronous suspension>
[        ]            #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[        ]            <asynchronous suspension>
[        ]            #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[   +1 ms]            <asynchronous suspension>
[        ]            #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #10     main (package:flutter_tools/executable.dart:94:3)
[   +1 ms]            <asynchronous suspension>
[   +1 ms] [  +16 ms] "flutter assemble" took 1,26,045ms.
[ +232 ms] [ +269 ms] ensureAnalyticsSent: 267ms
[   +2 ms] [   +1 ms] Running shutdown hooks
[  +13 ms] [        ] Shutdown hooks complete
[   +7 ms] [   +1 ms] exiting with code 1
[ +187 ms] > Task :app:compileFlutterBuildRelease FAILED
[  +84 ms] FAILURE: Build failed with an exception.
[   +2 ms] * Where:
[   +2 ms] Script 'C:\My Program Setup\Flutter Components\Flutter Dev\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
[  +55 ms] * What went wrong:
[   +1 ms] Execution failed for task ':app:compileFlutterBuildRelease'.
[        ] > Process 'command 'C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\flutter.bat'' finished with non-zero exit value 1
[   +1 ms] * 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.
[   +1 ms] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 2m 14s
[   +1 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[        ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[        ] 1 actionable task: 1 executed
[ +547 ms] Running Gradle task 'assembleRelease'... (completed in 135.4s)
[  +10 ms] "flutter apk" took 1,38,125ms.
[  +51 ms] Gradle task assembleRelease failed with exit code 1
[   +2 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:400:9)
           <asynchronous suspension>
           #2      AndroidGradleBuilder.buildApk (package:flutter_tools/src/android/gradle.dart:179:5)
           <asynchronous suspension>
           #3      BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:112:5)
           <asynchronous suspension>
           #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
           <asynchronous suspension>
           #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #12     main (package:flutter_tools/executable.dart:94:3)
           <asynchronous suspension>


[ +269 ms] ensureAnalyticsSent: 261ms
[   +4 ms] Running shutdown hooks
[   +4 ms] Shutdown hooks complete
[   +1 ms] exiting with code 1
@darshankawar darshankawar added the in triage Presently being triaged by the triage team label Jan 27, 2022
@darshankawar
Copy link
Member

@anandsubbu007
Can you provide a self contained but complete minimal reproducible code sample without any 3rd party plugins that replicates this error ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 27, 2022
@alexmarkov
Copy link
Contributor

@anandsubbu007 Please run gen_snapshot with --trace-compiler option:

"C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\cache\artifacts\engine\android-arm-release\windows-x64\gen_snapshot" --trace-compiler --deterministic --snapshot_kind=app-aot-elf "--elf=C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\armeabi-v7a\app.so" --strip --no-sim-use-hardfp --no-use-integer-division

That should print the name of the function being compiled when compiler crashes. Could post the source code of that function here?

Also, it would be useful to get a flow graph for that function. That could be done with --print-flow-graph --print-flow-graph-filter=FUNCTION_NAME options (replace FUNCTION_NAME with the actual name printed at the end of --trace-compiler output).

@anandsubbu007
Copy link
Author

@anandsubbu007 Please run gen_snapshot with --trace-compiler option:

"C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\cache\artifacts\engine\android-arm-release\windows-x64\gen_snapshot" --trace-compiler --deterministic --snapshot_kind=app-aot-elf "--elf=C:\Users\anand\Desktop\Github\Pawn-Shop\pawn_shop\.dart_tool\flutter_build\ac15500203bb4f8521d2a3872da40401\armeabi-v7a\app.so" --strip --no-sim-use-hardfp --no-use-integer-division

That should print the name of the function being compiled when compiler crashes. Could post the source code of that function here?

Also, it would be useful to get a flow graph for that function. That could be done with --print-flow-graph --print-flow-graph-filter=FUNCTION_NAME options (replace FUNCTION_NAME with the actual name printed at the end of --trace-compiler output).

thanks.

I believe there may be a bug in the external package "Isar" that I'm using in this.

Precompiling optimized function: 'package:pawn_shop/Backend/DataBase/Models/AppUser.dart_::_GetAppUserCollection|get#appUsers' @ token 382, size 78
--> 'package:pawn_shop/Backend/DataBase/Models/AppUser.dart_::_GetAppUserCollection|get#appUsers' entry: 0x214d6498 size: 64 time: 4678 us
Precompiling optimized function: 'package:isar/isar.dart_Isar_getCollection' @ token 2520, size 275
--> 'package:isar/isar.dart_Isar_getCollection' entry: 0x214d64e0 size: 320 time: 3206 us
Precompiling optimized function: 'package:isar/isar.dart_Isar_open' @ token 986, size 780
--> 'package:isar/isar.dart_Isar_open' entry: 0x214d6628 size: 948 time: 4997 us
Precompiling optimized function: 'package:isar/isar.dart_Isar_open_<anonymous closure>' @ token 1375, size 26
--> 'package:isar/isar.dart_Isar_open_<anonymous closure>' entry: 0x214d69e8 size: 60 time: 3696 us
Precompiling optimized function: 'package:isar/src/native/open.dart_::_openIsarNative' @ token 185, size 2091
--> 'package:isar/src/native/open.dart_::_openIsarNative' entry: 0x214d6a30 size: 364 time: 5593 us
Precompiling optimized function: 'package:isar/src/native/open.dart_::_openIsarNative__async_op' @ token 198, size 2078
Retrying compilation package:isar/src/native/open.dart_::_openIsarNative__async_op, suppressing inlining of deopt_id:272
Retrying compilation package:isar/src/native/open.dart_::_openIsarNative__async_op, suppressing inlining of deopt_id:272
../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3298: error: unreachable code

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 27, 2022
@alexmarkov
Copy link
Contributor

I tried creating a sample which uses package:isar, but I wasn't able to reproduce the crash - it builds fine. I used isar 1.0.5 for that as it was mentioned in the build log.

@anandsubbu007 It looks like we still need a complete sample reproducing the problem in order to investigate this error. Can you try to extract just the code which uses package:isar and cut down unrelated pieces of the app? The repro code doesn't need to run - it just needs to be syntactically correct and crash the compiler.

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 28, 2022
@jason-simmons jason-simmons added the dependency: dart Dart team may need to help us label Jan 28, 2022
@anandsubbu007
Copy link
Author

anandsubbu007 commented Jan 30, 2022

Problems Occurs When 'Isar.open()' function runs.

import 'dart:io';
import 'package:flutter/material.dart';
import 'dart:async';
import 'package:isar/isar.dart';
import 'package:path_provider/path_provider.dart' as pth;

void main() async {
  runApp(const AndroidAppInit());
}

class AndroidAppInit extends StatelessWidget {
  const AndroidAppInit({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    Future redisterdb() async {
      Directory dir = await pth.getApplicationDocumentsDirectory();
      await Isar.open(schemas: [AppUserSchema], directory: dir.path);
    }

    return FutureBuilder(
      future: redisterdb(),
      builder: (ctx, snap) {
        return const Scaffold(body: Text('Teting'));
      },
    );
  }
}

@Collection()
class AppUser {
  @Id()
  int? index;
  String? name;
  AppUser({this.index, this.name = ''});
}
environment:
  sdk: ">=2.16.0-134.1.beta <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  isar: ^2.1.0
  isar_flutter_libs: ^2.1.0
  path_provider: ^2.0.8

dev_dependencies:
  flutter_test:
    sdk: flutter
  build_runner: ^2.1.7
  isar_generator: ^2.1.0

An Error occurs in External Library only on Android Build.
Working fines in Windows Build

flutter build apk --release --verbose
[  +95 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +606 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +2 ms] 73adb1406a9cff796e2203ad16fd285220a6ec97
[   +1 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git tag --points-at 73adb1406a9cff796e2203ad16fd285220a6ec97
[  +81 ms] Exit code 0 from: git tag --points-at 73adb1406a9cff796e2203ad16fd285220a6ec97
[        ] 2.10.0-0.2.pre
[  +16 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +54 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/beta
[        ] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git ls-remote --get-url origin
[  +51 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +153 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref HEAD
[  +65 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] beta
[  +73 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +8 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.       
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.    
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.     
[   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.     
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.    
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +146 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[  +18 ms] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[   +6 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[ +193 ms] Skipping pub get: version match.
[  +91 ms] Found plugin isar_flutter_libs at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\isar_flutter_libs-2.1.0\
[  +36 ms] Found plugin path_provider at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.8\
[   +3 ms] Found plugin path_provider_android at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.11\
[   +6 ms] Found plugin path_provider_ios at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.7\
[   +6 ms] Found plugin path_provider_linux at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.5\
[   +2 ms] Found plugin path_provider_macos at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.5\
[   +6 ms] Found plugin path_provider_windows at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.5\
[ +137 ms] Found plugin isar_flutter_libs at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\isar_flutter_libs-2.1.0\
[  +11 ms] Found plugin path_provider at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider-2.0.8\
[   +3 ms] Found plugin path_provider_android at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.11\
[   +2 ms] Found plugin path_provider_ios at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_ios-2.0.7\
[   +2 ms] Found plugin path_provider_linux at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_linux-2.1.5\
[   +3 ms] Found plugin path_provider_macos at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_macos-2.0.5\
[   +4 ms] Found plugin path_provider_windows at C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_windows-2.0.5\
[  +51 ms] Generating
C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +134 ms]  Building with sound null safety 
[  +29 ms] Running Gradle task 'assembleRelease'...
[   +9 ms] Using gradle from C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\android\gradlew.bat.
[  +24 ms] executing: C:\My Program Setup\Flutter Components\Android Studio\jre\bin\java -version
[ +186 ms] Exit code 0 from: C:\My Program Setup\Flutter Components\Android Studio\jre\bin\java -version
[        ] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
           OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
[   +5 ms] executing: [C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\android/]
C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\android\gradlew.bat -Pverbose=true
-Ptarget-platform=android-arm,android-arm64,android-x64 -Ptarget=lib\main.dart -Pbase-application-name=android.app.Application -Pdart-obfuscation=false-Ptrack-widget-creation=true -Ptree-shake-icons=true assembleRelease
[+4606 ms] > Task :app:compileFlutterBuildRelease
[   +1 ms] [  +80 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[   +4 ms] [ +643 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +1 ms] [        ] 73adb1406a9cff796e2203ad16fd285220a6ec97
[   +1 ms] [        ] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git tag --points-at
73adb1406a9cff796e2203ad16fd285220a6ec97
[   +2 ms] [  +68 ms] Exit code 0 from: git tag --points-at 73adb1406a9cff796e2203ad16fd285220a6ec97
[   +1 ms] [        ] 2.10.0-0.2.pre
[   +1 ms] [  +23 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +1 ms] [  +63 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[   +6 ms] [        ] origin/beta
[   +4 ms] [        ] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git ls-remote --get-url origin
[   +2 ms] [  +66 ms] Exit code 0 from: git ls-remote --get-url origin
[   +1 ms] [        ] https://github.com/flutter/flutter.git
[   +8 ms] [  +72 ms] executing: [C:\My Program Setup\Flutter Components\Flutter Dev\flutter/] git rev-parse --abbrev-ref HEAD
[   +4 ms] [  +49 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[   +1 ms] [        ] beta
[   +1 ms] [  +59 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] [   +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[        ] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +223 ms] [ +228 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[   +2 ms] [   +4 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'WindowsUwpEngineArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] [        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +3 ms] [        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +10 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[  +20 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[   +7 ms] [        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[   +2 ms] [        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +19 ms] [ +126 ms] Initializing file store
[   +1 ms] [  +38 ms] Done initializing file store
[ +297 ms] [ +272 ms] Skipping target: gen_localizations
[        ] [  +18 ms] Skipping target: gen_dart_plugin_registrant
[ +711 ms] [ +714 ms] Skipping target: kernel_snapshot
[   +1 ms] [   +3 ms] android_aot_release_android-arm: Starting due to {}
[  +91 ms] [   +8 ms] executing: C:\My Program Setup\Flutter Components\Flutter
Dev\flutter\bin\cache\artifacts\engine\android-arm-release\windows-x64\gen_snapshot --deterministic --snapshot_kind=app-aot-elf
--elf=C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\.dart_tool\flutter_build\c1f522729a8888c0ec1c066966be0412\armeabi-v7a\app.so     
--strip --no-sim-use-hardfp --no-use-integer-division
C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\.dart_tool\flutter_build\c1f522729a8888c0ec1c066966be0412\app.dill
[   +3 ms] [  +77 ms] aot_android_asset_bundle: Starting due to {InvalidatedReasonKind.inputChanged: The following inputs have updated contents:
C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\pubspec.yaml}
[  +90 ms] [  +38 ms] Skipping target: android_aot_release_android-arm64
[   +1 ms] [  +17 ms] Skipping target: android_aot_release_android-x64
[ +421 ms] [ +393 ms] Running command: C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\cache\dart-sdk\bin\dart.exe --disable-dart-dev
C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\cache\artifacts\engine\windows-x64\const_finder.dart.snapshot --kernel-file
C:\Users\anand\Desktop\Github\flutter_native_opencv-master\demo\.dart_tool\flutter_build\c1f522729a8888c0ec1c066966be0412\app.dill --class-library-uri 
package:flutter/src/widgets/icon_data.dart --class-name IconData
[ +989 ms] [+1035 ms] aot_android_asset_bundle: Complete
[  +93 ms] [  +78 ms] Skipping target: android_aot_bundle_release_android-arm64
[        ] [  +30 ms] Skipping target: android_aot_bundle_release_android-x64
[+1900 ms] [+1866 ms] ../../third_party/dart/runtime/vm/compiler/aot/precompiler.cc: 3298: error: unreachable code
[ +597 ms] [   +3 ms] Persisting file store
[   +1 ms] [  +15 ms] Done persisting file store
[   +1 ms] [ +589 ms] Dart snapshot generator failed with exit code -1073740791
[        ] [  +14 ms] Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073740791
[   +1 ms]            #0      AndroidAot.build (package:flutter_tools/src/build_system/targets/android.dart:257:7)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:839:9)
[        ]            <asynchronous suspension>
[        ]            #2      Future.wait.<anonymous closure> (dart:async/future.dart:473:21)
[        ]            <asynchronous suspension>
[        ]            #3      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:777:32)
[        ]            <asynchronous suspension>
[        ]            #4      Future.wait.<anonymous closure> (dart:async/future.dart:473:21)
[        ]            <asynchronous suspension>
[   +1 ms]            #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:777:32)
[        ]            <asynchronous suspension>
[   +1 ms]            #6      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:606:16)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #7      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:317:32)
[   +1 ms]            <asynchronous suspension>
[        ]            #8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
[        ]            <asynchronous suspension>
[        ]            #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #10     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]            <asynchronous suspension>
[   +1 ms]            #11     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9) 
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #13     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #14     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[   +1 ms]            <asynchronous suspension>
[        ]            #15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #16     main (package:flutter_tools/executable.dart:94:3)
[   +1 ms]            <asynchronous suspension>
[   +2 ms] [   +6 ms] 
[   +1 ms]            #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[   +2 ms]            #1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:334:7)
[        ]            <asynchronous suspension>
[        ]            #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
[        ]            <asynchronous suspension>
[        ]            #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9) 
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[   +1 ms]            #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[   +2 ms]            <asynchronous suspension>
[   +2 ms]            #10     main (package:flutter_tools/executable.dart:94:3)
[   +1 ms]            <asynchronous suspension>
[   +1 ms] [  +15 ms] "flutter assemble" took 5,603ms.
[ +238 ms] [ +254 ms] ensureAnalyticsSent: 253ms
[   +6 ms] [   +1 ms] Running shutdown hooks
[   +2 ms] [        ] Shutdown hooks complete
[   +3 ms] [        ] exiting with code 1
[  +11 ms] > Task :app:compileFlutterBuildRelease FAILED
[   +1 ms] FAILURE: Build failed with an exception.
[   +3 ms] * Where:
[  +56 ms] Script 'C:\My Program Setup\Flutter Components\Flutter Dev\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
[   +2 ms] * What went wrong:
[   +7 ms] Execution failed for task ':app:compileFlutterBuildRelease'.
[   +1 ms] > Process 'command 'C:\My Program Setup\Flutter Components\Flutter Dev\flutter\bin\flutter.bat'' finished with non-zero exit value 1        
[   +1 ms] * 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.
[   +1 ms] * Get more help at https://help.gradle.org
[   +3 ms] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[   +1 ms] Use '--warning-mode all' to show the individual deprecation warnings.
[   +1 ms] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[   +1 ms] 1 actionable task: 1 executed
[   +1 ms] BUILD FAILED in 10s
[ +511 ms] Running Gradle task 'assembleRelease'... (completed in 11.3s)
[   +6 ms] "flutter apk" took 12,304ms.
[   +5 ms] Gradle task assembleRelease failed with exit code 1
[   +1 ms] 
           #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
           #1      AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:400:9)
           <asynchronous suspension>
           #2      AndroidGradleBuilder.buildApk (package:flutter_tools/src/android/gradle.dart:179:5)
           <asynchronous suspension>
           #3      BuildApkCommand.runCommand (package:flutter_tools/src/commands/build_apk.dart:112:5)
           <asynchronous suspension>
           #4      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
           <asynchronous suspension>
           #5      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #6      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
           <asynchronous suspension>
           #7      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
           <asynchronous suspension>
           #8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #9      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
           <asynchronous suspension>
           #10     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
           <asynchronous suspension>
           #11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
           <asynchronous suspension>
           #12     main (package:flutter_tools/executable.dart:94:3)
           <asynchronous suspension>


[ +198 ms] ensureAnalyticsSent: 191ms
[   +2 ms] Running shutdown hooks
[   +1 ms] Shutdown hooks complete
[   +1 ms] exiting with code 1

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 30, 2022
@darshankawar
Copy link
Member

Thanks for the code sample, using it, I do see the same stacktrace / behavior as reported originally.

console error log

[   +1 ms] [ +589 ms] Dart snapshot generator failed with exit code -1073740791
[        ] [  +14 ms] Target android_aot_release_android-arm failed: Exception: AOT snapshotter exited with code -1073740791
[   +1 ms]            #0      AndroidAot.build (package:flutter_tools/src/build_system/targets/android.dart:257:7)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #1      _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:839:9)
[        ]            <asynchronous suspension>
[        ]            #2      Future.wait.<anonymous closure> (dart:async/future.dart:473:21)
[        ]            <asynchronous suspension>
[        ]            #3      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:777:32)
[        ]            <asynchronous suspension>
[        ]            #4      Future.wait.<anonymous closure> (dart:async/future.dart:473:21)
[        ]            <asynchronous suspension>
[   +1 ms]            #5      _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:777:32)
[        ]            <asynchronous suspension>
[   +1 ms]            #6      FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:606:16)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #7      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:317:32)
[   +1 ms]            <asynchronous suspension>
[        ]            #8      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
[        ]            <asynchronous suspension>
[        ]            #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #10     CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[        ]            <asynchronous suspension>
[   +1 ms]            #11     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9) 
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #12     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #13     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #14     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[   +1 ms]            <asynchronous suspension>
[        ]            #15     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #16     main (package:flutter_tools/executable.dart:94:3)
[   +1 ms]            <asynchronous suspension>
[   +2 ms] [   +6 ms] 
[   +1 ms]            #0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[   +2 ms]            #1      AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:334:7)
[        ]            <asynchronous suspension>
[        ]            #2      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1161:27)
[        ]            <asynchronous suspension>
[        ]            #3      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[        ]            #4      CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #5      FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9) 
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #6      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[        ]            <asynchronous suspension>
[   +1 ms]            #7      FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #8      run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[   +1 ms]            <asynchronous suspension>
[   +1 ms]            #9      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[   +2 ms]            <asynchronous suspension>
[   +2 ms]            #10     main (package:flutter_tools/executable.dart:94:3)
[   +1 ms]            <asynchronous suspension>
[   +1 ms] [  +15 ms] "flutter assemble" took 5,603ms.
[ +238 ms] [ +254 ms] ensureAnalyticsSent: 253ms
[   +6 ms] [   +1 ms] Running shutdown hooks
[   +2 ms] [        ] Shutdown hooks complete
[   +3 ms] [        ] exiting with code 1
[  +11 ms] > Task :app:compileFlutterBuildRelease FAILED
[   +1 ms] FAILURE: Build failed with an exception.
[   +3 ms] * Where:
[  +56 ms] Script 'C:\My Program Setup\Flutter Components\Flutter Dev\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1102
[   +2 ms] * What went wrong:
[   +7 ms] Execution failed for task ':app:compileFlutterBuildRelease'.

beta, master flutter doctor -v

[√] Flutter (Channel master, 2.10.0-1.0.pre.337, on Microsoft Windows [Version 10.0.19042.1415], locale en-US)
    • Flutter version 2.10.0-1.0.pre.337 at D:\FlutterSDK\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 53771aba0c (9 hours ago), 2022-01-31 01:15:14 +0530
    • Engine revision fccb9b670d
    • Dart version 2.17.0 (build 2.17.0-67.0.dev)
    • DevTools version 2.10.0-dev.1

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at C:\Users\Win\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files (x86)\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.2)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31624.102
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.62.3)
    • VS Code at C:\Users\Win\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.28.0

[√] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Windows (desktop)       • windows     • windows-x64     • Microsoft Windows [Version 10.0.19042.1415]
    • Windows (UWP) (desktop) • winuwp      • windows-uwp-x64 •
    • Chrome (web)            • chrome      • web-javascript  • Google Chrome 96.0.4664.110
    • Edge (web)              • edge        • web-javascript  • Microsoft Edge 96.0.1054.62

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

[√] Flutter (Channel beta, 2.10.0-0.2.pre, on Microsoft Windows [Version 10.0.19043.1466], locale en-IN)
    • Flutter version 2.10.0-0.2.pre at D:\FlutterSDK\flutter      
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 73adb1406a (7 days ago), 2022-01-19 17:02:56 -0600
    • Engine revision 74b74b10ea
    • Dart version 2.16.0 (build 2.16.0-134.1.beta)
    • DevTools version 2.9.2

[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)        
    • Android SDK at C:\Users\Win\AppData\Local\Android\sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)     
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.11.6)      
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.11.31829.152
    • Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2020.3)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[√] VS Code (version 1.61.0)
    • VS Code at C:\Users\Win\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.27.0

[√] Connected device (5 available)
    • SM G975F (mobile)       • RZ8M802WY0X • android-arm64   • Android 11 (API 30)
    • Windows (desktop)       • windows     • windows-x64     • Microsoft Windows [Version 10.0.19042.1415]
    • Windows (UWP) (desktop) • winuwp      • windows-uwp-x64 •
    • Chrome (web)            • chrome      • web-javascript  • Google Chrome 96.0.4664.110
    • Edge (web)              • edge        • web-javascript  • Microsoft Edge 96.0.1054.62

[√] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

@darshankawar darshankawar added a: build Building flutter applications with the tool found in release: 2.10 Found to occur in 2.10 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically c: crash Stack traces logged to the console and removed in triage Presently being triaged by the triage team labels Jan 31, 2022
@darshankawar darshankawar changed the title Runs fine in debug. can't able to build apk. unreachable code Dart snapshot generator failed with exit code - Execution failed for task ':app:compileFlutterBuildRelease'. Flutter AOT precompiler crash using isar package. Jan 31, 2022
@alexmarkov alexmarkov self-assigned this Jan 31, 2022
@alexmarkov
Copy link
Contributor

Minimal repro:

import 'dart:ffi';

@pragma("vm:never-inline")
external Pointer<Uint32> foo();

main(List<String> args) {
  final Pointer<Uint32> offsetsPtr = foo();

  for (var i = 0; i < 2; i++) {
    print(offsetsPtr.asTypedList(1));
  }
}

Crash happens when AOT-compiling for 32-bit ARM. Code generation crashes as there is a deoptimizing (speculative) instruction v238 <- IntConverter(uint32->int32, v159) in AOT mode (which doesn't support deoptimization) and retrying without speculative inlining doesn't help.

This instruction is inserted by SelectRepresentations pass:

    v159 <- LoadField(v3 . Pointer.data_field {final}) T{_Mint}
    v238 <- IntConverter(uint32->int32, v159)
    StoreInstanceField(v157 . TypedDataBase.data_field = v238 T{_Mint}, NoStoreBarrier)

This probably happens due to mismatch between types of Pointer.data_field and TypedDataBase.data_field in slot.h:

  V(Pointer, UntaggedPointer, data_field, FfiIntPtr, FINAL)                    \
  V(TypedDataBase, UntaggedTypedDataBase, data_field, IntPtr, VAR)             \

where kUnboxedIntPtr is signed but kUnboxedFfiIntPtr is unsigned.

@alexmarkov
Copy link
Contributor

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Feb 1, 2022
On 32-bit ARM in AOT mode Pointer.asTypedList is generated so that
there is a LoadField from Pointer.data_field which has kUnboxedFfiIntPtr
representation (uint32) and then the value is passed to a
StoreInstanceField for TypedDataBase.data_field which has kUnboxedIntPtr
representation (int32). As a result, a speculative uint32->int32
IntConverter instruction is inserted by SelectRepresentations pass.
AOT doesn't support deoptimization so code generation crashes after
retrying without speculative inlining.

This change fixes the type incompatibility by loading value with
LoadUntagged and then converting it with ConvertUntaggedToUnboxed(kUnboxedIntPtr).

TEST=ffi/regress_flutter97301_test
Fixes flutter/flutter#97301

Change-Id: I4a00d4ac7978b4775add0ddae510841a2b4cbae0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230956
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
@alexmarkov
Copy link
Contributor

The fix rolled into Flutter in 981df81.

@anandsubbu007
Copy link
Author

may I know when will this update on flutter which version?

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Feb 8, 2022
On 32-bit ARM in AOT mode Pointer.asTypedList is generated so that
there is a LoadField from Pointer.data_field which has kUnboxedFfiIntPtr
representation (uint32) and then the value is passed to a
StoreInstanceField for TypedDataBase.data_field which has kUnboxedIntPtr
representation (int32). As a result, a speculative uint32->int32
IntConverter instruction is inserted by SelectRepresentations pass.
AOT doesn't support deoptimization so code generation crashes after
retrying without speculative inlining.

This change fixes the type incompatibility by loading value with
LoadUntagged and then converting it with ConvertUntaggedToUnboxed(kUnboxedIntPtr).

TEST=ffi/regress_flutter97301_test
Fixes flutter/flutter#97301

Change-Id: I4a00d4ac7978b4775add0ddae510841a2b4cbae0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230956
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
@fryette
Copy link

fryette commented Feb 10, 2022

@anandsubbu007 flutter 2.10.1 released

copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Feb 14, 2022
On 32-bit ARM in AOT mode Pointer.asTypedList is generated so that
there is a LoadField from Pointer.data_field which has kUnboxedFfiIntPtr
representation (uint32) and then the value is passed to a
StoreInstanceField for TypedDataBase.data_field which has kUnboxedIntPtr
representation (int32). As a result, a speculative uint32->int32
IntConverter instruction is inserted by SelectRepresentations pass.
AOT doesn't support deoptimization so code generation crashes after
retrying without speculative inlining.

This change fixes the type incompatibility by loading value with
LoadUntagged and then converting it with ConvertUntaggedToUnboxed(kUnboxedIntPtr).

TEST=ffi/regress_flutter97301_test
Fixes flutter/flutter#97301

Change-Id: I4a00d4ac7978b4775add0ddae510841a2b4cbae0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/230956
Reviewed-by: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: build Building flutter applications with the tool c: crash Stack traces logged to the console dependency: dart Dart team may need to help us found in release: 2.10 Found to occur in 2.10 has reproducible steps The issue has been confirmed reproducible and is ready to work on platform-android Android applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

No branches or pull requests

5 participants