flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
165.69k stars 27.36k forks source link

Wrong full snapshot version, expected '8f8...' found '48a...' after upgrade #16103

Closed zoechi closed 5 years ago

zoechi commented 6 years ago

Steps to Reproduce

[ +203 ms] Building APK
Running 'gradlew assembleDebug'...
[{"event":"app.progress","params":{"appId":"6e652d5b-16ee-4e34-aa5f-5cbb89f0e914","id":"2","progressId":null,"message":"Running 'gradlew assembleDebug'..."}}]
[  +11 ms] [android/] /Users/zoechi/dart/customers/lookatyou/lookatmybaby/lookatmybaby_flutter/android/gradlew -q -Ptarget=/Users/zoechi/dart/customers/lookatyou/lookatmybaby/lookatmybaby_flutter/lib/main_zoechi.dart -Ppreview-dart-2=true -Pfilesystem-scheme=org-dartlang-root assembleDebug
[ +997 ms] Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
[  +71 ms] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
[        ] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
[        ] registerResGeneratingTask is deprecated, use registerGeneratedFolders(FileCollection)
[+1890 ms] compiler message: Wrong full snapshot version, expected '8f8bcefc1534f548f00d8d817877e101' found '48af31030bbb45e2f3e620514fd8a27d'
[  +34 ms] Compiler terminated unexpectedly on /Users/zoechi/dart/customers/lookatyou/lookatmybaby/lookatmybaby_flutter/lib/main_zoechi.dart
[  +24 ms] FAILURE: Build failed with an exception.
[        ] * Where:
[        ] Script '/Users/zoechi/flutter/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 441
[        ] * What went wrong:
[        ] Execution failed for task ':app:flutterDependenciesDebug'.
[        ] > Process 'command '/Users/zoechi/flutter/flutter/bin/flutter'' 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.
[        ] * Get more help at https://help.gradle.org
[        ] BUILD FAILED in 2s
[{"event":"app.progress","params":{"appId":"6e652d5b-16ee-4e34-aa5f-5cbb89f0e914","id":"2","progressId":null,"finished":true}}]
Finished with error: Gradle build failed: 1

Logs

Run your application with flutter run and attach all the log output.

Run flutter analyze and attach any output of that command also.

Flutter Doctor

Paste the output of running flutter doctor -v here.

(dart2) $ flutter doctor -v
[✓] Flutter (Channel dev, v0.2.2-pre.6, on Mac OS X 10.13.3 17D102, locale en-AT)
    • Flutter version 0.2.2-pre.6 at /Users/zoechi/flutter/flutter
    • Framework revision 972ff23c4c (49 minutes ago), 2018-03-30 18:15:04 +0200
    • Engine revision 9af82c5a1a
    • Dart version 2.0.0-dev.43.0.flutter-e305117519

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /usr/local/opt/android-sdk
    • Android NDK at /usr/local/opt/android-sdk/ndk-bundle
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = /usr/local/opt/android-sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.4.0

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Ultimate Edition (version 2017.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    • Flutter plugin version 22.2.2
    • Dart plugin version 173.4548.30

[✓] Connected devices (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!

For more information about diagnosing and reporting Flutter bugs, please see https://flutter.io/bug-reports/.

zoechi commented 6 years ago

flutter clean and purging ~/flutter/bin/cache didn't help

zoechi commented 6 years ago

A new project created with flutter create fails the same way

zoechi commented 6 years ago

after a number of retries with something like git reset --hard git clean -xffd flutter doctor I was able to get rid of the error.

Feel free to close if you don't see anything you could do.

a-siva commented 6 years ago

Not able to gather much info from your logs, did you run into this problem again? I will close the issue, if you run into it again please reopen it and capture the steps you went through when the error occurred.

justinmc commented 5 years ago

I ran into this as well while trying to run an app on the iOS simulator on a Mac, and git clean -xffd in the Flutter repo directory fixed it for me.

benjaminhorner commented 5 years ago

I also ran into this after upgrading Flutter (master channel). git clean -xffd did not solve the issue. However, switching channels back and forth (from master to dev and back) fixed it for me.

michalsuryntequiqo commented 5 years ago

@justinmc - git clean -xffd solved the issue, thanks!

korgara commented 5 years ago

Switching channel from stable to master solved this for me.

Mallikarjun-0369 commented 5 years ago

W rong full snapshot version, expected '8343f188ada07642f47c56e518f1307c' found 'f630ecdf457e27dd24d3b9e0a6bc1c13'

I solate creation failed

Compiler failed on E:\DotEventures\Projects\ProductSupplier\toourssupplier\lib/main.dart Gradle task 'assembleDebug'... Done 20.6s Gradle task assembleDebug failed with exit code 1

E:\DotEventures\Projects\ProductSupplier\toourssupplier>flutter doctor -v

[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.648], locale en-US) • Flutter version 1.0.0 at C:\flutter\flutter_stable_v1\flutter • Framework revision 5391447fae (4 months ago), 2018-11-29 19:41:26 -0800 • Engine revision 7375a0f414 • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[√] Android toolchain - develop for Android devices (Android SDK 28.0.3) • Android SDK at C:\Users\DEPL-06\AppData\Local\Android\Sdk • Android NDK location not configured (optional; useful for native profiling support) • Platform android-28, build-tools 28.0.3 • ANDROID_HOME = C:\Users\DEPL-06\AppData\Local\Android\Sdk • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01) • All Android licenses accepted.

[√] Android Studio (version 3.3) • Android Studio at C:\Program Files\Android\Android Studio • Flutter plugin version 34.0.1 • Dart plugin version 182.5215 • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] VS Code (version 1.32.3) • VS Code at C:\Users\DEPL-06\AppData\Local\Programs\Microsoft VS Code • Flutter extension not installed; install from https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (1 available) • Android SDK built for x86 • emulator-5554 • android-x86 • Android 7.0 (API 24) (emulator)

! Doctor found issues in 1 category.

long1eu commented 5 years ago

I have this problem also. Switching channels dind help.

sergiossm commented 5 years ago

Running flutter channel master, flutter upgrade and flutter clean worked for me

noordawod commented 5 years ago

Running flutter channel master, flutter upgrade and flutter clean worked for me too.

KevinTheGray commented 5 years ago

The solution that fixed it for me was deleting everything inside /flutter/bin/cache

ThinkDigitalSoftware commented 5 years ago

I'm getting this now as well. Verbose logs

[   +8 ms] executing: /Users/thinkdigital/Library/Android/sdk/platform-tools/adb -s FA68T0306130 install -t -r /Users/thinkdigital/GoogleDrive/Development/IdeaProjects/teddycare/build/app/outputs/apk/app.apk
[+12766 ms] Performing Streamed Install
            Success
[{"event":"app.progress","params":{"appId":"1c9a9ca7-9b17-44eb-98ac-fc5fdb7afaab","id":"3","progressId":null,"finished":true}}]
[   +5 ms] executing: /Users/thinkdigital/Library/Android/sdk/platform-tools/adb -s FA68T0306130 shell echo -n 2ca788634bfd9326173f2851cce19c51d3b6fec2 > /data/local/tmp/sky.com.teddycare.flutterapp.sha1
[  +29 ms] Pixel startApp
[   +3 ms] executing: /Users/thinkdigital/Library/Android/sdk/platform-tools/adb -s FA68T0306130 shell am start -a android.intent.action.RUN -f 0x20000000 --ez enable-background-compilation true --ez enable-dart-profiling true --ez enable-checked-mode true --ez verify-entry-points true --ez start-paused true com.teddycare.flutterapp/com.teddycare.flutterapp.MainActivity
[ +118 ms] Starting: Intent { act=android.intent.action.RUN flg=0x20000000 cmp=com.teddycare.flutterapp/.MainActivity (has extras) }
[        ] Waiting for observatory port to be available...
[+1039 ms] F/flutter ( 9400): [FATAL:flutter/runtime/dart_vm.cc(380)] Error while initializing the Dart VM: Wrong full snapshot version, expected '9e1fa667daca1ecf538db8507091794e' found '3383321009c0898417a99b9df9a73876'
ThinkDigitalSoftware commented 5 years ago

Tried changing to beta and dev, deleting everything inside flutter/bin/cache, ran flutter clean, ran git clean -xffd I still get the same error. I even upgraded flutter .

[✓] Flutter (Channel dev, v1.4.15, on Mac OS X 10.14.4 18E226, locale en-US) • Flutter version 1.4.15 at /Users/thinkdigital/development/flutter • Framework revision ed91a3be49 (9 hours ago), 2019-04-10 10:35:03 -0500 • Engine revision 905c571db5 • Dart version 2.2.1 (build 2.2.1-dev.3.1 None)

ThinkDigitalSoftware commented 5 years ago

Interesting. I ran a different project and it built, and when I went back to my current project, it built...

Mallikarjun-0369 commented 5 years ago

Hey,

You can resolve it by changing from master cannel and get back again to stable channel. I did same thing to resolve. It may help.

On Thu, Apr 11, 2019, 5:38 AM Jonathan White notifications@github.com wrote:

I'm getting this now as well. F/flutter (26970): [FATAL:flutter/runtime/dart_vm.cc(380)] Error while initializing the Dart VM: Wrong full snapshot version, expected '9e1fa667daca1ecf538db8507091794e' found '3383321009c0898417a99b9df9a73876'

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/16103#issuecomment-481916437, or mute the thread https://github.com/notifications/unsubscribe-auth/AthbvMJrcdKGyL8CfC-REPr04f0NgBKGks5vfnzggaJpZM4TB6Yj .

shihaohong commented 5 years ago

I was getting this too and resolved it with git clean -xffd. Unsure what the root cause of it was, but I would get the same error regardless of whatever application I was trying to run on an Android simulator.

Edit: As mentioned in a later comment, git clean -xffd deletes everything that was not stored in your repository, so be careful using it as you may lose unsaved work.

ThinkDigitalSoftware commented 5 years ago

Actually, this is only when running on Android. It still fails for me. Works when using the iOS simulator

Mallikarjun-0369 commented 5 years ago

Did you migrated to androidX

On Thu, Apr 11, 2019, 6:06 AM Jonathan White notifications@github.com wrote:

Actually, this is only when running on Android. It still fails for me. Works when using the iOS simulator

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/16103#issuecomment-481921269, or mute the thread https://github.com/notifications/unsubscribe-auth/AthbvGJ81-_wXR5GmiCpKeTt-vAsT7Qkks5vfoNzgaJpZM4TB6Yj .

delay commented 5 years ago

Problem also occurred for me. It happened when I tried to change channels from dev back to stable. git clean -xffd did not work for me.

clearing out ~/flutter/bin/cache followed by flutter clean again finally worked.

smile2014 commented 5 years ago

Running Gradle task 'assembleDebug'... Wrong full snapshot version, expected '67d5e890b128b2d4141263de5f1ac0d1' found '0c73eb70aa4d30f450273cb424be8c62'

LinusU commented 5 years ago

Cleaning out $FLUTTER_HOME/bin/cache did the trick for me 👏

KevinTheGray commented 5 years ago

For people's future reference, be careful with git clean -xffd, it deleted everything that wasn't stored in the repository, eg. secret keys, etc. It is my own fault for not looking into what it would would do, but it was a bit of a surprise to see I needed to re-add some files

Tameflame commented 5 years ago

Deleting everything in flutter/bin/cache then running flutter doctor worked for me.

I'm on the stable channel, for what it's worth

gadfly361 commented 5 years ago

@Tameflame Thank you, your suggestion did the trick for me!

tzvc commented 5 years ago

Same problem when switching to channel stable. I tried flutter clean and git clean -xffd, still no luck :/

jonahwilliams commented 5 years ago

If you've clean'd the project in question, the next step would be to delete the tool cache directory to force it to redownload any artifacts. This is located at FLUTTER_ROOT/bin/cache - everything in that directory is safe to delete

tzvc commented 5 years ago

@jonahwilliams I tried this too without success. I ended up reinstalling flutter completely and the problem went away

GustavoContreiras commented 5 years ago

after a number of retries with something like git reset --hard git clean -xffd flutter doctor I was able to get rid of the error.

Feel free to close if you don't see anything you could do.

It worked for me but it also removed the latest changes that I made and didn't commit. People should use it carefully. Thanks anyway.

ThinkDigitalSoftware commented 5 years ago

This should be run from the flutter directory as far as I understand. Not your local project

On Mon, May 6, 2019 at 11:43 PM Gustavo Contreiras notifications@github.com wrote:

after a number of retries with something like git reset --hard git clean -xffd flutter doctor I was able to get rid of the error.

Feel free to close if you don't see anything you could do.

It worked for me but it also removed the latest changes that I made and didn't commit. People should use it carefully. Thanks anyway.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/flutter/flutter/issues/16103#issuecomment-489929371, or mute the thread https://github.com/notifications/unsubscribe-auth/AFPYO7OFEUI2FLG2Q5ZXCCTPUEQIPANCNFSM4EYHUYRQ .

-- Think Digital 323-638-9448 760-678-8833 Facebook.com/ThinkDigitalRepair

AkramChauhan commented 5 years ago

while doing

git clean -xffd

Unlink of file 'bin/cache/BIT5646.tmp' failed.

What should I do?

canberkozer commented 5 years ago

I tried all the tricks but still the same. Should I setup Dart and Flutter again?

pvallada commented 5 years ago

I had the same issue and ended up having to re-install flutter to get rid of it.

bjornbjorn commented 5 years ago

rm -rf flutter/bin/cache and then flutter doctor -v fixed the issue for me✌️

manney12 commented 5 years ago

Running flutter channel master, flutter upgrade and flutter clean worked for me, ive been looking for a way to solve this issue but although i would like to know why it worked ?

ashersuman commented 5 years ago

I had a copy of dart installed on my system after I uninstalled that,the issue was fixed. Check if have any other copies of dart ✌️

diegomgarcia commented 5 years ago

I'm getting this same error trying to build an windows desktop embedded app ...

I've done the follow steps:

1- git clone flutter 2- add path to enviroment variables (flutter\bin) 3- changed the to master. flutter channel master 4- flutter upgrade 5- git clone https://github.com/google/flutter-desktop-embedding.git 6- cd into example folder 7- flutter package get 8- flutter run -v

I've tried to chande the dart sdk version, but it didnt work out ...

And here is the log after flutter run:

[ +1 ms] | example_flutter:lib/ [ +26 ms] Running "flutter pub get" in example... (completed in 4,2s) [ +240 ms] Launching lib\main.dart on Windows in debug mode... [ +99 ms] Building Windows application... [ +218 ms]


[ +1 ms] Visual Studio 2019 Developer Command Prompt v16.2.0 [ ] Copyright (c) 2019 Microsoft Corporation [ ]


[ +985 ms] [vcvarsall.bat] Environment initialized for: 'x64' [ +91 ms] Microsoft(R) Build Engine versão 16.2.32702+c4012a063 para .NET Framework [ ] Copyright (C) Microsoft Corporation. Todos os direitos reservados. [ +14 ms] Compilando os projetos desta solução um por vez. Para habilitar o build paralelo, adicione a opção "-m". [ +241 ms] Compilação de 28/07/2019 00:32:27 iniciada. [ +718 ms] Projeto "C:\Files\flutter-desktop-embedding-master\example\windows\Runner.sln" no nó 1 (destinos padrão). [ +14 ms] ValidateSolutionConfiguration: [ ] Compilando a configuração de solução "Debug|x64". [ +513 ms] O projeto "C:\Files\flutter-desktop-embedding-master\example\windows\Runner.sln" (1) está

compilando "C:\Files\flutter-desktop-embedding-master\example\windows\Runner.vcxproj" (2) no nó 1 (destinos padrão). [ +2 ms] InitializeBuildStatus: [ ] Tocando "C:\Files\flutter-desktop-embedding-master\example\windows..\build\windows\inte

rmediates\x64\Debug\Runner\Runner.tlog\unsuccessfulbuild". [ +2 ms] PreBuildEvent: [ +12 ms] Sync and build dependencies [ +6 ms] "C:\Files\flutter-desktop-embedding-master\example\windows\scripts\prepare_depen

dencies" debug [ +6 ms] :VCEnd

Wrong full snapshot version, expected '1d7acad1540192ac459cf60344efb7c1' found '34948253b59d5a56b2ec161e17975a4e'

C:\Files\flutter-desktop-embedding-master\example\lib\main.dart [ +22 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(128,

5): error MSB3073: O comando ""C:\Files\flutter-desktop-embedding-master\example\windows\scripts\prepare_depe

ndencies" debug [C:\Files\flutter-desktop-embedding-master\example\windows\Runner.vcxproj] [ +1 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(128,

5): error MSB3073: :VCEnd" foi encerrado com o código 1. [C:\Files\flutter-desktop-embedding-master\example\windows\Runner.vcxproj] [ +5 ms] Projeto de compilação pronto "C:\Files\flutter-desktop-embedding-master\example\windows\Runner.vcxproj" (destinos padrão) -- FALHA. [ +19 ms] Projeto de compilação pronto "C:\Files\flutter-desktop-embedding-master\example\windows\Runner.sln" (destinos

padrão) -- FALHA. [ +26 ms] FALHA da compilação. [ +4 ms] "C:\Files\flutter-desktop-embedding-master\example\windows\Runner.sln" (destino padrão) (1) -> [ +1 ms] "C:\Files\flutter-desktop-embedding-master\example\windows\Runner.vcxproj" (destino padrão) (2) -> [ +1 ms] (PreBuildEvent destino) -> [ ] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(128,

5): error MSB3073: O comando ""C:\Files\flutter-desktop-embedding-master\example\windows\scripts\prepare_depe

ndencies" debug [C:\Files\flutter-desktop-embedding-master\example\windows\Runner.vcxproj] [ +2 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(128,

a-siva commented 5 years ago

Have you tried this "rm -rf flutter/bin/cache"

lamkr commented 5 years ago

Folks, I can't delete this folder 'cause the dart-sdk is there! Are you removing ALL content in this folder or only the files?

a-siva commented 5 years ago

Remove all contents in the folder, the dart-sdk will get downloaded again when you run any flutter command after deleting the cache directory.

lamkr commented 5 years ago

It do not works:

$ flutter doctor -v Checking Dart SDK version... Flutter requires PowerShell 5.0 or newer. See https://flutter.dev/docs/get-started/install/windows for more. Building flutter tool... Running pub upgrade... The system cannot found specified path. Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)

AshokSongara commented 4 years ago

Follow below steps issue will be fixed Change your Flutter channel to Master using below command

flutter channel master

the execute below command

flutter run

the issue will be solved and your dart version will be updated

subzero911 commented 4 years ago

I also ran into this when I checked out the old Flutter commit v1.2.0 (to compile the old project), and then returned to the latest commit v1.17.4.

GuoZhiQiang commented 4 years ago

rm -rf flutter/bin/cache and then flutter doctor -v worked for me too

bigc2000 commented 4 years ago

is there any good way to solve it ? So many people encountered the problem!

vibhavkarthik03 commented 3 years ago

If somebody still looking for an answer, updating dart-sdk worked for me. Try running choco upgrade dart-sdk

github-actions[bot] commented 3 years ago

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.