Since yesterday evening I've been unable to open my app in emulator. It worked fine till then.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
√ Built build\app\outputs\flutter-apk\app-debug.apk.
It usually takes about 2 mins to open but it was just stuck there for like 15 mins. So I looked up for answers and the first one said to use gradlew clean and gradlew build. I did that and still was stuck but with another error.
Launching lib\main.dart on Android SDK built for x86 in debug mode...
lib\main.dart:1
Note: C:\flutter\.pub-cache\hosted\pub.dartlang.org\path_provider_android-2.0.12\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Then I tried an answer from a similar question here that suggested to do flutter pub cache repair. Still no luck.
Then I tried another suggestion from an answer here to upgrade flutter. I hadn't upgraded flutter for a couple months since so I did that but still the issue persists.
I read from a comment to a question here that when they run the project using flutter run -v in terminal it opened up after about 20 mins. So I started it and because my laptop is like 6 years old running 6th gen i5 with 8gb ram I thought it might take a bit longer. So I left it there and now after about 2 hours my terminal is stuck at:
I hit the question character limit so I put the terminal's output in
an online notepad at: https://anotepad.com/notes/3jri4gpc
I just closed the emulator and the terminal added this to the above
[+7331895 ms] executing: C:\Users\hp\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell pm list packages com.example.myapp
[ +90 ms] adb.exe: device offline
[ +27 ms] ProcessException: Process exited abnormally:
adb.exe: device offline
Command: C:\Users\hp\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 shell pm list packages com.example.myapp
[ +3 ms] Installing APK.
[ +17 ms] Installing build\app\outputs\flutter-apk\app.apk...
[ +8 ms] executing: C:\Users\hp\AppData\Local\Android\sdk\platform-tools\adb.exe -s emulator-5554 install -t -r
D:\myapp\front\myapp\build\app\outputs\flutter-apk\app.apk
[ +114 ms] Performing Push Install
adb: error: failed to get feature set: device 'emulator-5554' not found
[ +6 ms] Installing build\app\outputs\flutter-apk\app.apk... (completed in 115ms)
[ +5 ms] Error: ADB exited with exit code -1
[ +4 ms] Performing Push Install
adb: error: failed to get feature set: device 'emulator-5554' not found
[ +1 ms] Warning: Failed to install APK.
[ +4 ms] Error launching application on Android SDK built for x86.
[ +9 ms] "flutter run" took 7,368,695ms.
[ +23 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:687:9)
<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>
#5 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
<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)
<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)
<asynchronous suspension>
[ +172 ms] ensureAnalyticsSent: 163ms
[ +10 ms] Running shutdown hooks
[ +2 ms] Shutdown hooks complete
[ +2 ms] exiting with code 1
From [+7331895 ms] executing: in the first line after closing the emulator I can see that this was running for about 122 minutes.
I don't understand what's wrong here. Why did the emulator stop working normally all of a sudden?
How to make it work so that I can continue with my app development? Please help.
Related
I am working on a CI pipeline for my flutter desktop app, currently it's Windows only but this will soon change to be Windows/Linux. I was planning to use the GitLab shared runners with the cirrusci/flutter docker image to automate this.
Unfortunately, when running the command I am greeted with this log:
"build windows" only supported on Windows hosts.
Which makes total sense, since flutter builds native apps and likely requires the SDKs.
I was wondering if anyone is familiar with how to set up a pipeline for Windows desktop applications to be built. I can switch GitLab to use a Windows shared runner, but this doesn't have a flutter install.
Just wondering what the path of least resistance is here.. I've reached the end of my surface-level understanding of these systems (Docker + GitLab CI)
Thank you,
David
I'm trying to do the same. I took this project as an example https://gitlab.com/famedly/fluffychat/-/blob/main/.gitlab-ci.yml
I ended up with a job looking like this (in the .gitlab-ci.yml):
build_test_app_win_job:
stage: build
tags:
- shared-windows
- windows
- windows-1809
before_script:
# Install flutter (using Chocolatey and confirming all prompts)
- choco install flutter --confirm --no-progress
- Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
- refreshenv
# Disable Google Analytics report for Flutter
- flutter config --no-analytics
script:
- cd test_app/
- flutter pub get
- flutter build windows -v >> debugCiLog.txt
However I'm stuck with a weird error during build (despite all being ok on my local computer):
[ +321 ms] C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(231,5): error MSB6006: "cmd.exe" exited with code 1. [C:\GitLab-Runner\builds\TestProject\test_app\build\windows\flutter\flutter_assemble.vcxproj]
With verbose on:
[ +74 ms] [ +8 ms] Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command.
[ +8 ms] [ +3 ms]
[ ] #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
[ ] #1 AssembleCommand.runCommand (package:flutter_tools/src/commands/assemble.dart:295:7)
[ ] #2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1374:12)
[ ] <asynchronous suspension>
[ ] #3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1209:27)
[ ] <asynchronous suspension>
[ ] #4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #5 CommandRunner.runCommand (package:args/command_runner.dart:209:13)
[ ] <asynchronous suspension>
[ ] #6 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:281:9)
[ ] <asynchronous suspension>
[ ] #7 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #8 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:229:5)
[ ] <asynchronous suspension>
[ ] #9 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:62:9)
[ ] <asynchronous suspension>
[ ] #10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
[ ] <asynchronous suspension>
[ ] #11 main (package:flutter_tools/executable.dart:91:3)
[ ] <asynchronous suspension>
[ +2 ms] [ +67 ms] "flutter assemble" took 621ms.
[ ] [ +5 ms] ensureAnalyticsSent: 2ms
[ ] [ +1 ms] Running shutdown hooks
[ ] [ ] Shutdown hooks complete
[ ] [ +6 ms] exiting with code 1
The following error is probably wrong, I can not find something relevant on google (I have no space or special character in the path):
Error parsing assemble command: your generated configuration may be out of date. Try re-running 'flutter build ios' or the appropriate build command.
Maybe this can help you despite I fail on my setup. I would be interested if you have more success than me 😉
Also, I try flutter doctor and all seems ok:
Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.6.4)
Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.17763.1339], locale en-US)
Yesterday i woke up and found my Visual studio misbehaving. I had to delete all my file in .graddle folder and then re-download them but it's giving the errors below, i have tried googling for solutions but all in vain.
I am using Graddle:
gradle-6.7-all.zip
I am using linux mint distro.
-Pfilesystem-scheme=org-dartlang-root assembleDebug
[+454406 ms] FAILURE: Build failed with an exception.
[ +7 ms] * What went wrong:
[ +1 ms] A problem occurred configuring root project 'android'.
[ +1 ms] > Could not resolve all artifacts for configuration ':classpath'.
[ +2 ms] > Could not download builder-4.1.0.jar (com.android.tools.build:builder:4.1.0)
[ +1 ms] > Could not get resource
'https://dl.google.com/dl/android/maven2/com/android/tools/build/builder/4.1.0/builder-4.1.0.jar'.
[ +9 ms] > Premature end of Content-Length delimited message body (expected: 9,546,513; received: 4,456,416)
[ +2 ms] > Could not download kotlin-compiler-embeddable-1.3.50.jar
(org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50)
[ +11 ms] > Could not get resource
'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.3.50/kotlin-compiler-embeddable-1.3.50.jar'.
[ +4 ms] > Premature end of Content-Length delimited message body (expected: 36,615,572; received: 4,456,416)
[ +1 ms] > Could not download fastutil-7.2.0.jar (it.unimi.dsi:fastutil:7.2.0)
[ +2 ms] > Could not get resource 'https://jcenter.bintray.com/it/unimi/dsi/fastutil/7.2.0/fastutil-7.2.0.jar'.
[ +5 ms] > Premature end of Content-Length delimited message body (expected: 17,309,408; received: 6,553,552)
[ +2 ms] * Try:
[ +2 ms] 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.
[ +3 ms] * Get more help at https://help.gradle.org
[ +1 ms] BUILD FAILED in 7m 33s
[ +627 ms] Running Gradle task 'assembleDebug'... (completed in 455.5s)
[ +10 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +4 ms] "flutter run" took 461,160ms.
[ +14 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:644:9)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:1157:12)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1009:27)
<asynchronous suspension>
#4 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#5 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#6 CommandRunner.runCommand (package:args/command_runner.dart:197:13)
<asynchronous suspension>
#7 FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:278:9)
<asynchronous suspension>
#8 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#9 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#10 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:234:5)
<asynchronous suspension>
#11 run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:64:9)
<asynchronous suspension>
#12 run.<anonymous closure> (package:flutter_tools/runner.dart:62:12)
<asynchronous suspension>
#13 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#14 AppContext.run (package:flutter_tools/src/base/context.dart:149:12)
<asynchronous suspension>
#15 runInContext (package:flutter_tools/src/context_runner.dart:73:10)
<asynchronous suspension>
#16 main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>
[ +260 ms] ensureAnalyticsSent: 252ms
[ +3 ms] Running shutdown hooks
[ ] Shutdown hook priority 4
[ +14 ms] Shutdown hooks complete
[ +1 ms] exiting with code 1
Folks,
I am re-building an already built flutter application upon changing of the laptop. However I have strangely observed that the dependencies that we mention in the pubspec, not all of them are getting compiled. Those ones which has native dependencies and eventually have android code base in the dependencies fail to compile. I am cluless how this is happening and where should i look forward to get this going. The only error I get is as below. The contentious dependencies were share and connectivity
warning: [options] source value 7 is obsolete and will be removed in a future release
[ +5 ms] warning: [options] target value 7 is obsolete and will be removed in a future release
[ +1 ms] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[ +1 ms] error: warnings found and -Werror specified
[ +190 ms] FAILURE: Build failed with an exception.
[ ] * What went wrong:
[ ] Execution failed for task ':share:compileDebugJavaWithJavac'.
[ +97 ms] > Compilation failed; see the compiler error output for details.
[ ] * 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.
[ +3 ms] * Get more help at https://help.gradle.org
[ +1 ms] BUILD FAILED in 1m 41s
[ +1 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.
[ +5 ms] See https://docs.gradle.org/6.5/userguide/command_line_interface.html#sec:command_line_warnings
[ ] 410 actionable tasks: 4 executed, 406 up-to-date
[ +794 ms] Running Gradle task 'assembleDebug'... (completed in 103.9s)
[ +9 ms] Exception: Gradle task assembleDebug failed with exit code 1
[ +4 ms] "flutter run" took 1,08,191ms.
[ +9 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:607:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:977:18)
<asynchronous suspension>
#3 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:836:33)
<asynchronous suspension>
#4 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart)
#5 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:150:29)
#6 _rootRun (dart:async/zone.dart:1190:13)
#7 _CustomZone.run (dart:async/zone.dart:1093:19)
#8 _runZoned (dart:async/zone.dart:1630:10)
#9 runZoned (dart:async/zone.dart:1550:10)
#10 AppContext.run (package:flutter_tools/src/base/context.dart:149:18)
#11 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:825:20)
#12 CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#13 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:335:21)
#14 _rootRunUnary (dart:async/zone.dart:1198:47)
#15 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#16 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#17 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#18 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#19 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#20 Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#21 _rootRun (dart:async/zone.dart:1190:13)
#22 _CustomZone.run (dart:async/zone.dart:1093:19)
#23 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#24 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#25 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#26 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#27 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#28 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)
[ +6 ms] ensureAnalyticsSent: 3ms
[ +3 ms] Running shutdown hooks
[ ] Shutdown hook priority 4
[ +12 ms] Shutdown hooks complete
[ +1 ms] exiting with code 1
I am using flutter 1.22.6 stable
dart 2.10.5
Gradle 6.5
I have tried it out with 1.22.3 and also with 1.20.4, still this is not taking me anywhere. All that it ends up is not compiling the dependencies having android code in it. gradlew assembleDebug --info and likes of it has resulted in me understanding that the java symbols are not created which eventually are not found by the compilation script, hence it is generating error.
things ive done so far:
run with --no-sound-null-safety and --verbose
find dependencies that complain and check for updates, then update to latest in pubspec
one dependency complained about android min sdk version in gradle.build, so i updated accordingly
now i can build to my test machine and work out the runtime bugs!
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Flutter
The application works fine when I remove the "Image_picker" dependency.When I add back "shared_preferences" gives an error.
flutter run --release --verbose
This error is displayed when starting the application and when I want to use "shared_preferences".
[+8288 ms] E/flutter (10416): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: MissingPluginException(No implementation found
for method getAll on channel plugins.flutter.io/shared_preferences)
"Image_picke" gives this error.
[ +2 ms] E/flutter (10872):
[+18180 ms] E/flutter (10872): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: PlatformException(already_active, Image picker
is already active, null, null)
[ +3 ms] E/flutter (10872): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:581)
[ +1 ms] E/flutter (10872): #1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:158)
[ +1 ms] E/flutter (10872): <asynchronous suspension>
[ +2 ms] E/flutter (10872): #2 MethodChannelImagePicker.pickImage
(package:image_picker_platform_interface/src/method_channel/method_channel_image_picker.dart:29)
[ +2 ms] E/flutter (10872): <asynchronous suspension>
[ +1 ms] E/flutter (10872): #3 _PhotoAndNameState.takePicture (package:jokesapp/photoAndName.dart:22)
[ +1 ms] E/flutter (10872): <asynchronous suspension>
[ +2 ms] E/flutter (10872):
The error is fixed if I delete the dependency "Image_picker". But I have to use "Image_picker"
https://github.com/flutter/flutter/issues/40339 Someone mentioned this in this issues.
My better suggestion is to use your own channel to pick the image from native instead of using the third-party libraries, because sometimes you may get the plugin issues which will not be resolved and need to be waited until the plugin gets updated. Recently i faced the Permissions issue in flutter where i'm using permission_handler and the image_picker, the permission_handler i have used for microphone access, where as the image_picker will have their own permission checker. So when we include both the libraries in the project only one library will work because of the Override method of OnRequest and OnActivity.
The image_picker works for android 10 only in debug mode.
But I could not understand exactly what he was talking about. Since I will publish my application, "image_picker" is a safer choice for me.
I solved this problem days ago. Gradle version became 4.1.0 with new updates."Image_picker" dependency does not work in Gradle 4.1.0 version.Also, when it is in the same project with "shared_preferences" dependency, "shared_preferences" dependency also does not work.After removing "image_picker" from project, "shared_preferences" works correctly.So when we include both the libraries in the project only one library will work because of the Override method of OnRequest and OnActivity.
For more information.
#40339
SOLUTION
Sorry, the only solution is to drop the gradle version.
classpath 'com.android.tools.build:gradle:3.5.4'
I made the gradle version 3.5.4 and now everything works fine.
After lowering the Gradle version, if you get the NDK error, reduce the NDK version at the same time.
#76393
I just solved all the necessary dependencies.
Building flutter tool...
Running pub upgrade...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v0.7.3, on Microsoft Windows [Version 10.0.17134.228], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.2)
[√] Android Studio (version 3.1)
[√] IntelliJ IDEA Community Edition (version 2018.2)
[√] Connected devices (1 available)
Now when I try running the flutter app on Android Studio I get this.
A:\Project\flutter_app>flutter run
fatal: Not a git repository (or any of the parent directories): .git
Building flutter tool...
Running pub upgrade...
Running "flutter packages get" in flutter_app...
Could not find a file named "pubspec.yaml" in "C:\".
pub get failed (66)
Does anyone know what to do to resolve this issue?
[Update 2 hours later]
I deleted flutter and reinstalled in *C:\flutter* using the git repo
https://github.com/flutter/flutter.git
Now the error I am getting is this
A:\Project\flutter_app>flutter run
fatal: Not a git repository (or any of the parent directories): .git
Building flutter tool...
Running pub upgrade...
Running "flutter packages get" in flutter_app...
Cannot open file, path = '.\pubspec.lock' (OS Error: Access is denied.
, errno = 5)
pub get failed (66)
Update: I tried using verbose when running flutter packages upgrade -v and got this
C:\flutter\flutter_app>flutter packages upgrade -v
fatal: Not a git repository (or any of the parent directories): .git
Building flutter tool...
Running pub upgrade...
[ +31 ms] executing: [C:\Users\Nick\flutter\] git rev-parse --abbrev-ref --symbolic #{u}
[ +76 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic #{u}
[ +1 ms] origin/beta
[ ] executing: [C:\Users\Nick\flutter\] git rev-parse --abbrev-ref HEAD
[ +45 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ +1 ms] beta
[ ] executing: [C:\Users\Nick\flutter\] git ls-remote --get-url origin
[ +38 ms] Exit code 0 from: git ls-remote --get-url origin
[ +9 ms] https://github.com/flutter/flutter.git
[ ] executing: [C:\Users\Nick\flutter\] git log -n 1 --pretty=format:%H
[ +38 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ +1 ms] 3b309bda072a6b326e8aa4591a5836af600923ce
[ +7 ms] executing: [C:\Users\Nick\flutter\] git log -n 1 --pretty=format:%ar
[ +37 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ +1 ms] 9 days ago
[ ] executing: [C:\Users\Nick\flutter\] git describe --match v*.*.* --first-parent --long --tags
[ +41 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ +1 ms] v0.7.3-0-g3b309bda0
[ +170 ms] Running "flutter packages upgrade" in flutter_app...
[ +10 ms] executing: [C:\flutter\flutter_app\] C:\Users\Nick\flutter\bin\cache\dart-sdk\bin\pub.bat --verbosity=warning --verbose upgrade --no-precompile
[+16555 ms] Cannot open file, path = '.\pubspec.lock' (OS Error: Access is denied.
[ +1 ms] , errno = 5)
[ +46 ms] Running "flutter packages upgrade" in flutter_app... (completed)
[ +15 ms] "flutter upgrade" took 16,687ms.
pub upgrade failed (66)
#0 throwToolExit (package:flutter_tools/src/base/common.dart:26:3)
#1 pub (package:flutter_tools/src/dart/pub.dart:170:5)
<asynchronous suspension>
#2 pubGet (package:flutter_tools/src/dart/pub.dart:104:13)
<asynchronous suspension>
#3 PackagesGetCommand._runPubGet (package:flutter_tools/src/commands/packages.dart:59:11)
<asynchronous suspension>
#4 PackagesGetCommand.runCommand (package:flutter_tools/src/commands/packages.dart:82:11)
<asynchronous suspension>
#5 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:356:18)
#6 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#7 _rootRunUnary (dart:async/zone.dart:1132:38)
#8 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#9 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#10 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#11 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#12 Future._complete (dart:async/future_impl.dart:476:7)
#13 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#14 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#15 _rootRun (dart:async/zone.dart:1124:13)
#16 _CustomZone.run (dart:async/zone.dart:1021:19)
#17 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#18 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#19 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#20 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#21 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
Created GitHub issue https://github.com/flutter/flutter/issues/21495
Update: Not much has improved
#pskink asked me to create a new app in an empty directory while using verbose
Output:
C:\flutter>flutter create flutter_app -v
fatal: Not a git repository (or any of the parent directories): .git
Building flutter tool...
Running pub upgrade...
Multiple output directories specified.
Try moving -v to be immediately following create
#0 throwToolExit (package:flutter_tools/src/base/common.dart:26:3)
#1 CreateCommand.runCommand (package:flutter_tools/src/commands/create.dart:106:7)
<asynchronous suspension>
#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:356:18)
#3 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#4 _rootRunUnary (dart:async/zone.dart:1132:38)
#5 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#6 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#7 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#8 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#9 Future._complete (dart:async/future_impl.dart:476:7)
#10 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#11 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#12 _rootRun (dart:async/zone.dart:1124:13)
#13 _CustomZone.run (dart:async/zone.dart:1021:19)
#14 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#15 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#16 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#17 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#18 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
Don't copy .packages over from one machine to another. (It should be in .gitignore if using git.)
Instead, run flutter packages get on the mac, and it will recreate .packages.
(Don't copy .flutter-plugins either.)
Delete .packages
Delete pubspec.lock
Run below command shown in image
I assume this is caused by and outdated Git client.
Please ensure you only have one Git client in your PATH and that it is in a recent version.
I found a temporary solution. When I run the same command on Power Shell as an administrator it doesn't show any error.
PS C:\flutter\flutter_app> flutter packages get
fatal: not a git repository (or any of the parent directories): .git
Building flutter tool...
Running pub upgrade...
Running "flutter packages get" in C:\... 16.1s
PS C:\flutter\flutter_app> flutter packages upgrade
fatal: not a git repository (or any of the parent directories): .git
Building flutter tool...
Running pub upgrade...
Running "flutter packages upgrade" in C:\... 86.9s
kill dart.exe, try run
if still error,
after kill, reopen android studio as admin
Delete app/.packages file from your project and use flutter upgrade to get packages again.
This problem was related to my antivirus program. It worked when I uninstalled the block. Maybe it will help. I wish everybody good work
The same thing happened with me. But in my case I had set the property of the project folder to hidden. When I set that to unhide it started working.