Repository navigation
Gradle build fails after engine update #8607
Description
Steps to Reproduce
Running on flutter from 3 days ago app worked. After a flutter upgrade this morning (3/7) the app won't run. Running from Android Studio.
Logs
03-07 07:26:15.675 12331-12331/com.askllc.vinteresting E/ApkAssets: Error while loading asset assets/icudtl.dat: java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
03-07 07:26:15.698 12331-12331/com.askllc.vinteresting I/Adreno: QUALCOMM build : e781517, I9267f384df
Build Date : 10/26/16
OpenGL ES Shader Compiler Version: XE031.09.00.03
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.5.5.R1.07.00.00.269.009
Remote Branch : NONE
Reconstruct Branch : NOTHING
03-07 07:26:15.802 12331-12375/com.askllc.vinteresting E/flutter: [ERROR:../../lib/tonic/logging/dart_error.cc(16)] Wrong script snapshot version, expected '795c4aba89b54b4c51894de889493cdf' found '850b51cd3b18a02dc9f31c0b233f3fe3'
03-07 07:26:15.832 12331-12375/com.askllc.vinteresting E/flutter: [ERROR:../../lib/tonic/logging/dart_error.cc(16)] Unhandled exception:
NoSuchMethodError: No top-level getter 'main' declared.
Receiver: top-level
Tried calling: main
#0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:194)
#1 _getMainClosure (file:///b/build/slave/Linux_Engine/build/src/flutter/lib/ui/natives.dart:55)
03-07 07:26:15.916 12331-12378/com.askllc.vinteresting D/libc: [NET] android_getaddrinfofornetcontext+,hn 9(0x3132372e302e30),sn(),hints(known),family 0,flags 1024, proc=com.askllc.vinteresting
03-07 07:26:15.922 12331-12378/com.askllc.vinteresting D/libc: [NET] android_getaddrinfofornetcontext+,hn 9(0x3132372e302e30),sn(),hints(known),family 0,flags 1024, proc=com.askllc.vinteresting
03-07 07:26:16.009 12331-12390/com.askllc.vinteresting I/flutter: Diagnostic server listening on http://127.0.0.1:35175/
03-07 07:26:16.020 12331-12390/com.askllc.vinteresting I/flutter: Observatory listening on http://127.0.0.1:33483/
Flutter Doctor
Paste the output of running flutter doctor here.
[√] Flutter (on Windows, channel master)
• Flutter at C:\dev\flutter
• Framework revision 24eeddc (10 hours ago),
• Engine revision f9c1f5f
• Tools Dart version 1.23.0-dev.2.0
[√] Android toolchain - develop for Android devices (Android SDK 25.0.2)
• Android SDK at C:\Users\Rob\AppData\Local\Android\sdk
• Platform android-25, build-tools 25.0.2
• Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
[√] Android Studio (version 2.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Gradle version 3.2
[√] IntelliJ IDEA Community Edition (version 2016.3)
• Dart plugin version 163.13137
• Flutter plugin version 0.1.11.1
[√] Connected devices
• 2PS64 • HT69N0100346 • android-arm • Android 7.0 (API 24)
Activity
goderbauer commentedon Mar 7, 2017
In the directory of your application, can you delete the
buildsub-directory inside theandroiddirectory and thebuildsub-directory insideandroid/app. Also, delete the app on your phone and try again? Does that work?rbishop-bah commentedon Mar 7, 2017
@goderbauer Yes that worked.
goderbauer commentedon Mar 7, 2017
@jakobr-google Have you seen this before? Somehow, when the engine version is updated Gradle fails to either include the new sky_shell into the APK or fails to re-create the snapshot with the latest engine version causing this version miss-match on device:
The work around right now is to blow away the build artifacts of your app (see my previous comment) and force gradle to re-build everything.
[-]App wont run (Win 10) after upgrade[/-][+]Gradle build fails after engine update[/+]jakobr-google commentedon Mar 10, 2017
I've seen this recently as well (caused by a recent Dart SDK roll). We need to add an input dependency on gen_snapshot as well, so they build creates a new snapshot if gen_snapshot has changed.
Same issue as #8608, and slightly related to #8687.
Use snapshot's .d file as source inputs in Gradle build.
Use snapshot's .d file as source inputs in Gradle build. (#8756)
github-actions commentedon Sep 5, 2021
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 -vand a minimal reproduction of the issue.