2

The flutter build/sync process does not finish for me. It's stuck at Syncing files to device Android SDK built for x86....

The issue happens with every app and is not connected to the emulator itself, since even a physical device (Nexus 5X) has the same problem. For cempletions sake the emulator was created with flutter emulators --create --name nexus

My main problem is being unable to use hot-reload, debugging tools and other features. How could I further investigate/debug?


Console only

  • Compilation and execution works fine
  • App is responsive and console print statements work, with console output.

flutter doctor -v

[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US.UTF-8)
 • Flutter version 1.12.13+hotfix.8 at /home/jannik/devenv/flutter
 • Framework revision 0b8abb4724 (6 weeks ago), 2020年02月11日 11:44:36 -0800
 • Engine revision e1e6ced81d
 • Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
 • Android SDK at /home/jannik/devenv/android-sdk
 • Android NDK location not configured (optional; useful for native profiling support)
 • Platform android-28, build-tools 28.0.3
 • ANDROID_HOME = /home/jannik/devenv/android-sdk
 • ANDROID_SDK_ROOT = /home/jannik/devenv/android-sdk
 • Java binary at: /usr/bin/java
 • Java version OpenJDK Runtime Environment (build 1.8.0_232-solus-ga)
 • All Android licenses accepted.
[!] Android Studio (not installed)
 • Android Studio not found; download from https://developer.android.com/studio/index.html
 (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
[✓] Connected device (1 available)
 • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)
! Doctor found issues in 1 category.

flutter run

Using hardware rendering with device Android SDK built for x86. If you get graphics artifacts, consider
enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Running Gradle task 'assembleDebug'... 
Running Gradle task 'assembleDebug'... Done 11.8s
✓ Built build/app/outputs/apk/debug/app-debug.apk.
D/FlutterView( 4752): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@82cc314
Installing build/app/outputs/apk/app.apk... 1.7s
D/FlutterActivity( 5134): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate( 5134): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate( 5134): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
D/FlutterActivityAndFragmentDelegate( 5134): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView( 5134): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@eb0c503
D/FlutterActivityAndFragmentDelegate( 5134): Executing Dart entrypoint: main, and sending initial route: /
D/FlutterView( 4752): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@82cc314
D/EGL_emulation( 5134): eglMakeCurrent: 0xa6196880: ver 2 0 (tinfo 0xa48618e0)
Syncing files to device Android SDK built for x86...
I/flutter ( 5134): pressed 
Syncing files to device Android SDK built for x86...
I/flutter ( 5134): pressed 
Syncing files to device Android SDK built for x86...
I/flutter ( 5134): pressed 
Syncing files to device Android SDK built for x86...
(This is taking an unexpectedly long time.) ⣻

flutter run -v

https://gist.github.com/jnnksdev/78c1d2d1b6d86a06d387786c07667918


Visual Studio Code

  • Compilations seems fine
  • App is not responsive and does not show (white canvas, nothing else)

Run> Start Debugging

Launching lib/main.dart on Android SDK built for x86 in debug mode...
✓ Built build/app/outputs/apk/debug/app-debug.apk.
D/FlutterView( 4752): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@82cc314
D/FlutterActivity( 6179): Using the launch theme as normal theme.
D/FlutterActivityAndFragmentDelegate( 6179): Setting up FlutterEngine.
D/FlutterActivityAndFragmentDelegate( 6179): No preferred FlutterEngine was provided. Creating a new FlutterEngine for this FlutterFragment.
D/FlutterActivityAndFragmentDelegate( 6179): Attaching FlutterEngine to the Activity that owns this Fragment.
D/FlutterView( 6179): Attaching to a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@82cc314
D/FlutterActivityAndFragmentDelegate( 6179): Executing Dart entrypoint: main, and sending initial route: /
D/FlutterView( 4752): Detaching from a FlutterEngine: io.flutter.embedding.engine.FlutterEngine@82cc314

Flutter: Run Flutter Doctor

[flutter] flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Linux, locale en_US.UTF-8)
 • Flutter version 1.12.13+hotfix.8 at /home/jannik/devenv/flutter
 • Framework revision 0b8abb4724 (6 weeks ago), 2020年02月11日 11:44:36 -0800
 • Engine revision e1e6ced81d
 • Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
 • Android SDK at /home/jannik/devenv/android-sdk
 • Android NDK location not configured (optional; useful for native profiling support)
 • Platform android-28, build-tools 28.0.3
 • ANDROID_HOME = /home/jannik/devenv/android-sdk
 • ANDROID_SDK_ROOT = /home/jannik/devenv/android-sdk
 • Java binary at: /usr/bin/java
 • Java version OpenJDK Runtime Environment (build 1.8.0_232-solus-ga)
 • All Android licenses accepted.
[!] Android Studio (not installed)
 • Android Studio not found; download from https://developer.android.com/studio/index.html
 (or visit https://flutter.dev/setup/#android-setup for detailed instructions).
[✓] Connected device (1 available)
 • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

uname -a

Linux sol 5.5.7-150.current #1 SMP PREEMPT Wed Mar 4 03:31:00 UTC 2020 x86_64 GNU/Linux
asked Mar 26, 2020 at 14:21
0

4 Answers 4

3

I did not find out why the syncing process does not finish, but the solution is to switch to a "newer" flutter channel with flutter channel beta for example.

You can list availale channels with flutter channel. Don't forget to flutter upgrade after changing the channel.

answered Mar 29, 2020 at 13:34
Sign up to request clarification or add additional context in comments.

2 Comments

I am currently using beta channel and still getting this issue.
Works for me on master only.
3

Put this right before the runApp() statement in your main function

WidgetsFlutterBinding.ensureInitialized();

This fixed it for me.

iknow
10.3k15 gold badges47 silver badges81 bronze badges
answered Aug 19, 2020 at 17:41

1 Comment

it was happening again and again and just put this up and seems to be working. Will put another comment, if it occurs again! Thanks! :+1
2

I just found out that using firebaseMessaging plugin can cause this error. if you are using the onBackgroundMessage method, please try to comment it.

I've commented this line and the "syncing files to device" does not get stuck forever...

answered Feb 7, 2021 at 11:35

Comments

0

In my case it was a bug in my code using GetX that meant that the build tree was being unresponsive (e.g. infinite loop issue with Dropdown menu) and hence stalling sync. If I put a breakpoint before my GetX part it would refresh/sync

answered Jan 20, 2022 at 19:59

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.