1

我有一个颤振项目,如果我执行命令“颤动运行”,它就会卡在运行 Gradle 任务“assembleDebug”上。它不会抛出错误消息或任何它什么都不做的事情。这只发生在我的台式电脑上。在我的笔记本电脑上一切正常。

下面我将向你展示我的颤振医生 -v 输出和颤振运行 -v 输出,但首先我会告诉你我已经做了什么。

我重新安装了颤振和android sdk。我想,项目文件以某种方式损坏了,所以我删除了整个项目并从我的 git 存储库中再次将其拉出。

我创建了一个新项目,其中包含来自 Flutter 的默认示例应用程序(您知道可以在其中按下按钮的那个,它会在屏幕中间告诉您按下它的次数。)起初是有效的,所以我想我在尝试将 moor_flutter 包集成到我的应用程序时搞砸了。(我知道那不是真的,因为如果我把它搞砸了,它也不会在我的笔记本电脑上工作,但我很绝望。)

无论如何,我一步一步地执行并在每次更改后运行应用程序,这样我就可以检查我是否犯了错误。

第 1 步:在 pubspec.yaml 中添加依赖项

第2步:添加设置数据库和测试表。

第3步:初始化数据库类

每次更改后,我都清理了颤振应用程序,生成了一个新的“xxx.g.dart”文件,这是使用 moor_flutter 包所必需的。一切正常。那天晚些时候,在我恢复动力后,我回到了我的电脑上,并试图再次启动我的测试应用程序以找出我做错了什么。我运行了我的测试应用程序,突然它不再通过“运行 Gradle 任务 'assembleDebug'...”了,我不明白为什么,因为我没有改变任何东西。

我查看了其他有同样问题的人的帖子,有人建议这是因为 linux 内核 5.5.5-arch1-1 以某种方式破坏了 gradlew,但我升级了我的笔记本电脑以检查这是否属实,但它仍然可以在我的笔记本电脑上运行。

颤振医生 -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/jan/development/languages+devtools/flutter
    • Framework revision 0b8abb4724 (12 days 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 29.0.3)
    • Android SDK at /opt/android-sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-29, build-tools 29.0.3
    • ANDROID_HOME = /home/jan/development/languages+devtools/android-sdk
    • Java binary at:
      /home/jan/development/languages+devtools/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Android Studio (version 3.5)
    • Android Studio at /home/jan/development/languages+devtools/android-studio
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build
      1.8.0_202-release-1483-b49-5587405)

[✓] Connected device (1 available)
    • Mi MIX 2 • 78e7ab82 • android-arm64 • Android 9 (API 28)

• No issues found!

颤振运行 -v 输出:

[  +16 ms] executing: [/home/jan/development/languages+devtools/flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[  +23 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 0b8abb4724aa590dd0f429683339b1e045a1594d
[        ] executing: [/home/jan/development/languages+devtools/flutter/] git describe --match v*.*.* --first-parent --long --tags
[   +4 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.13+hotfix.8-0-g0b8abb472
[   +4 ms] executing: [/home/jan/development/languages+devtools/flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[   +4 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [/home/jan/development/languages+devtools/flutter/] git ls-remote --get-url origin
[   +4 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +31 ms] executing: [/home/jan/development/languages+devtools/flutter/] git rev-parse --abbrev-ref HEAD
[   +4 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[  +75 ms] executing: /opt/android-sdk/platform-tools/adb devices -l
[   +4 ms] Exit code 0 from: /opt/android-sdk/platform-tools/adb devices -l
[        ] List of devices attached
           78e7ab82               device usb:1-7 product:chiron model:Mi_MIX_2 device:chiron transport_id:3
[  +11 ms] /opt/android-sdk/platform-tools/adb -s 78e7ab82 shell getprop
[  +85 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[   +3 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.
[   +2 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.
[  +66 ms] Found plugin moor_ffi at
/home/jan/development/languages+devtools/flutter/.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.4.0/
[   +9 ms] Found plugin path_provider at
/home/jan/development/languages+devtools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.1/
[  +57 ms] Found plugin moor_ffi at
/home/jan/development/languages+devtools/flutter/.pub-cache/hosted/pub.dartlang.org/moor_ffi-0.4.0/
[   +3 ms] Found plugin path_provider at
/home/jan/development/languages+devtools/flutter/.pub-cache/hosted/pub.dartlang.org/path_provider-1.6.1/
[  +41 ms] Generating
/home/jan/development/projects/second_test_proj/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[  +28 ms] ro.hardware = qcom
[  +30 ms] Launching lib/main.dart on Mi MIX 2 in debug mode...
[   +7 ms] executing: /opt/android-sdk/platform-tools/adb -s 78e7ab82 shell -x logcat -v time -t 1
[ +118 ms] Exit code 0 from: /opt/android-sdk/platform-tools/adb -s 78e7ab82 shell -x logcat -v time -t 1
[   +1 ms] --------- beginning of main
           02-23 18:01:22.038 E/FIDOCA : (  752): get_fp_vendor property_get : none
[  +17 ms] executing: /opt/android-sdk/platform-tools/adb version
[   +2 ms] executing: /opt/android-sdk/platform-tools/adb -s 78e7ab82 logcat -v time -T 02-23 18:01:22.038
[  +41 ms] Android Debug Bridge version 1.0.41
           Version 29.0.6-6198805
           Installed as /opt/android-sdk/platform-tools/adb
[   +1 ms] executing: /opt/android-sdk/platform-tools/adb start-server
[   +6 ms] Building APK
[  +12 ms] Running Gradle task 'assembleDebug'...
[   +1 ms] gradle.properties already sets `android.enableR8`
[   +1 ms] Using gradle from /home/jan/development/projects/second_test_proj/android/gradlew.
[   +4 ms] executing: /home/jan/development/languages+devtools/android-studio/jre/bin/java -version
[  +36 ms] Exit code 0 from: /home/jan/development/languages+devtools/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)
[   +1 ms] executing: [/home/jan/development/projects/second_test_proj/android/]
/home/jan/development/projects/second_test_proj/android/gradlew -Pverbose=true
-Ptarget=/home/jan/development/projects/second_test_proj/lib/main.dart -Ptrack-widget-creation=true
-Pfilesystem-scheme=org-dartlang-root -Ptarget-platform=android-arm64 assembleDebug
[+3436 ms] Starting a Gradle Daemon, 3 busy and 9 stopped Daemons could not be reused, use --status for details
[+6993 ms] > Task :app:compileFlutterBuildDebug
[        ] [  +15 ms] executing: [/home/jan/development/languages+devtools/flutter/] git -c log.showSignature=false log -n 1
--pretty=format:%H
[        ] [  +19 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H

感谢您提前提供帮助。请原谅任何拼写错误,英语不是我的第一语言。如果您需要更多信息,请询问。:)

4

2 回答 2

0

因此,在我尝试在笔记本电脑上使用我的应用程序后,我自己想通了。周日晚上,我可以将应用程序从笔记本电脑推送到智能手机,但昨天在学校我什么也做不了。所以我想它一定是我的操作系统。我将我的 linux 内核更改为 lts 版本,现在一切正常。

于 2020-02-27T20:57:29.230 回答
0

andoid studio->tools->flutter->在studio中打开andoid模块

尝试在打开 android 模块后运行。对我来说,在我收到终端错误之后。

于 2021-02-16T08:53:35.137 回答