Simon
Simon

Reputation: 39

Flutter app can't be run in emulator on Linux mint

i'm working on my first project on android studio using flutter I created the default project by flutter create project_name,but when i run it with flutter run ,i wait a lot of time but no result ...

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'... 

And it still like that :/ i was working on windows and it was perfectly working but after fixing all problems that faces me to run it on linux mint tina ,i finish by getting no result But after a mount of time i got these errors

Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: /home/simo/.gradle/wrapper/dists/gradle-5.6.2-all/9st6wgf78h16so49nn74lgtbb/gradle-5.6.2-all.zip
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.Install.createDist(Install.java:48)
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...                                                                                             
Running Gradle task 'assembleDebug'... Done                       120.3s (!)
[!] Gradle threw an error while trying to update itself. Retrying the update...
Running Gradle task 'assembleDebug'...                                  
Exception in thread "main" java.lang.RuntimeException: Timeout of 120000 reached waiting for exclusive access to file: /home/simo/.gradle/wrapper/dists/gradle-5.6.2-all/9st6wgf78h16so49nn74lgtbb/gradle-5.6.2-all.zip
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.ExclusiveFileAccessManager.access(ExclusiveFileAccessManager.java:61)
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.Install.createDist(Install.java:48)
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:128)
Running Gradle task 'assembleDebug'...                                                  
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:61)
Running Gradle task 'assembleDebug'...                                                                                             
Running Gradle task 'assembleDebug'... Done                       120.2s (!)
[!] Gradle threw an error while trying to update itself. Retrying the update...
Gradle task assembleDebug failed with exit code 1

What can i do to fix that ? Thank you in advance ! And when i run that : flutter run -v --enable-software-rendering

[  +15 ms] executing: [/home/simo/flutter/] git -c log.showSignature=false log
-n 1 --pretty=format:%H
[  +25 ms] Exit code 0 from: git -c log.showSignature=false log -n 1
--pretty=format:%H
[        ] 0b8abb4724aa590dd0f429683339b1e045a1594d
[        ] executing: [/home/simo/flutter/] git describe --match v*.*.*
--first-parent --long --tags
[   +6 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long
--tags
[        ] v1.12.13+hotfix.8-0-g0b8abb472
[   +7 ms] executing: [/home/simo/flutter/] git rev-parse --abbrev-ref
--symbolic @{u}
[   +6 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/home/simo/flutter/] git ls-remote --get-url origin
[   +5 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +42 ms] executing: [/home/simo/flutter/] git rev-parse --abbrev-ref HEAD
[   +9 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +83 ms] executing: /home/simo/Android/Sdk/platform-tools/adb devices -l
[  +10 ms] Exit code 0 from: /home/simo/Android/Sdk/platform-tools/adb devices
-l
[        ] List of devices attached
           emulator-5554          device product:sdk_gphone_x86
           model:Android_SDK_built_for_x86 device:generic_x86 transport_id:1
[  +16 ms] /home/simo/Android/Sdk/platform-tools/adb -s emulator-5554 shell
getprop
[  +33 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required,
skipping update.
[   +2 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.
[   +1 ms] Artifact Instance of 'WindowsEngineArtifacts' 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.
[ +124 ms] Generating
/home/simo/Documents/first_app_flutter/android/app/src/main/java/io/flutter/plug
ins/GeneratedPluginRegistrant.java
[  +23 ms] ro.hardware = ranchu
[  +31 ms] Using software rendering with device Android SDK built for x86. You
may get
           better performance with hardware mode by configuring hardware
rendering for your
           device.
[  +16 ms] Launching lib/main.dart on Android SDK built for x86 in debug mode...
[  +10 ms] executing: /home/simo/Android/Sdk/platform-tools/adb -s emulator-5554
shell -x logcat -v time -t 1
[  +25 ms] Exit code 0 from: /home/simo/Android/Sdk/platform-tools/adb -s
emulator-5554 shell -x logcat -v time -t 1
[        ] --------- beginning of system
           02-19 13:26:36.363 W/AppOps  ( 2133): Noting op not finished: uid
           10102 pkg com.google.android.gms code 41 time=1582115190374
           duration=0
[   +7 ms] executing: /home/simo/Android/Sdk/platform-tools/adb version
[        ] executing: /home/simo/Android/Sdk/platform-tools/adb -s emulator-5554
logcat -v time -T 02-19 13:26:36.363
[  +26 ms] Android Debug Bridge version 1.0.41
           Version 29.0.5-5949299
           Installed as /home/simo/Android/Sdk/platform-tools/adb
[   +2 ms] executing: /home/simo/Android/Sdk/platform-tools/adb start-server
[  +11 ms] Building APK
[  +18 ms] Running Gradle task 'assembleDebug'...
[   +1 ms] gradle.properties already sets `android.enableR8`
[   +2 ms] Using gradle from
/home/simo/Documents/first_app_flutter/android/gradlew.
[   +8 ms] executing: /home/simo/android-studio/jre/bin/java -version
[  +52 ms] Exit code 0 from: /home/simo/android-studio/jre/bin/java -version
[        ] openjdk version "1.8.0_202-release"
           OpenJDK Runtime Environment (build
           1.8.0_202-release-1483-b49-5587405)
           OpenJDK 64-Bit Server VM (build 25.202-b49-5587405, mixed mode)
[   +3 ms] executing: [/home/simo/Documents/first_app_flutter/android/]
/home/simo/Documents/first_app_flutter/android/gradlew -Pverbose=true
-Ptarget=/home/simo/Documents/first_app_flutter/lib/main.dart
-Ptrack-widget-creation=true -Pfilesystem-scheme=org-dartlang-root
-Ptarget-platform=android-x86 assembleDebug
[ +145 ms] Downloading
https://services.gradle.org/distributions/gradle-5.6.2-all.zip

Upvotes: 0

Views: 713

Answers (1)

Kavindu Tharaka
Kavindu Tharaka

Reputation: 281

Although the question is 1 year old, I will share my experience for those who will face the issue.

I also faced this issue and I tried the below steps and it worked for me.

  1. open the terminal inside your project.
  2. execute the command 👉 flutter clean
  3. execute the command 👉 flutter run

Upvotes: 2

Related Questions