Flutter - (ошибка: ADB завершен с кодом выхода 1) при использовании Bluestacks в качестве эмулятора - PullRequest
0 голосов
/ 13 апреля 2020

Приветствую всех участников и модераторов.

Я пытаюсь запустить проект флаттера по умолчанию в Android Studio (приложение счетчика), и я использую Bluestacks в качестве эмулятора.

Сначала я подключаю эмулятор с помощью команды adb следующим образом: adb connect 127.0.0.1.

Затем я запускаю проект с использованием flutter run -v, но процесс завершается с ошибкой.

Вот вывод команды flutter run -v:

[  +56 ms] executing: [C:\flutter\] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +217 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[   +3 ms] f139b11009aeb8ed2a3a3aa8b0066e482709dde3
[        ] executing: [C:\flutter\] git describe --match v*.*.* --first-parent --long --tags
[  +63 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[        ] v1.12.13+hotfix.9-0-gf139b1100
[  +13 ms] executing: [C:\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[  +68 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/stable
[        ] executing: [C:\flutter\] git ls-remote --get-url origin
[  +53 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[ +136 ms] executing: [C:\flutter\] git rev-parse --abbrev-ref HEAD
[  +75 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] stable
[ +424 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[ +241 ms] Exit code 0 from: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe devices -l
[        ] List of devices attached
           127.0.0.1:5555         device product:OnePlus5 model:ONEPLUS_A5000 device:OnePlus5 transport_id:4
[  +27 ms] C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 shell getprop
[ +113 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[  +23 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +8 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.
[   +1 ms] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +668 ms] Generating
C:\Users\eyadb\AndroidStudioProjects\flutter_app\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[  +92 ms] ro.hardware = qcom
[ +158 ms] Launching lib\main.dart on ONEPLUS A5000 in debug mode...
[  +22 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree
C:\Users\eyadb\AndroidStudioProjects\flutter_app\build\app\outputs\apk\app.apk AndroidManifest.xml
[+1038 ms] Exit code 0 from: C:\Users\eyadb\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree
C:\Users\eyadb\AndroidStudioProjects\flutter_app\build\app\outputs\apk\app.apk AndroidManifest.xml
[   +2 ms] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.flutterapp" (Raw: "com.example.flutterapp")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="flutterapp" (Raw: "flutterapp")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw:
                 "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.flutterapp.MainActivity" (Raw:
                   "com.example.flutterapp.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[  +13 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 shell -x logcat
-v time -t 1
[  +59 ms] Exit code 0 from: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 shell -x
logcat -v time -t 1
[   +2 ms] --------- beginning of main
           04-13 23:07:49.314 D/BstCommandProcessor-httpd( 1991): response: {"result":"ok"}
[  +13 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe version
[   +3 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 logcat -v time
-T 04-13 23:07:49.314
[  +49 ms] Android Debug Bridge version 1.0.41
           Version 29.0.6-6198805
           Installed as C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +6 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[  +45 ms] Building APK
[  +49 ms] Running Gradle task 'assembleDebug'...
[  +11 ms] gradle.properties already sets `android.enableR8`
[  +25 ms] Using gradle from C:\Users\eyadb\AndroidStudioProjects\flutter_app\android\gradlew.bat.
[ +143 ms] executing: E:\Android Studio\jre\bin\java -version
[ +922 ms] Exit code 0 from: E:\Android Studio\jre\bin\java -version
[   +2 ms] openjdk version "1.8.0_212-release"
           OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
           OpenJDK 64-Bit Server VM (build 25.212-b04, mixed mode)
[   +9 ms] executing: [C:\Users\eyadb\AndroidStudioProjects\flutter_app\android\]
C:\Users\eyadb\AndroidStudioProjects\flutter_app\android\gradlew.bat -Pverbose=true
-Ptarget=C:\Users\eyadb\AndroidStudioProjects\flutter_app\lib\main.dart -Ptrack-widget-creation=true
-Pfilesystem-scheme=org-dartlang-root -Ptarget-platform=android-x86 assembleDebug
[+16585 ms] > Task :app:compileFlutterBuildDebug UP-TO-DATE
[   +3 ms] > Task :app:packLibsflutterBuildDebug UP-TO-DATE
[  +10 ms] > Task :app:preBuild UP-TO-DATE
[  +10 ms] > Task :app:preDebugBuild UP-TO-DATE
[  +21 ms] > Task :app:compileDebugAidl NO-SOURCE
[   +7 ms] > Task :app:checkDebugManifest UP-TO-DATE
[   +2 ms] > Task :app:generateDebugBuildConfig UP-TO-DATE
[   +8 ms] > Task :app:javaPreCompileDebug UP-TO-DATE
[  +49 ms] > Task :app:compileDebugRenderscript NO-SOURCE
[  +86 ms] > Task :app:cleanMergeDebugAssets
[   +3 ms] > Task :app:mergeDebugShaders UP-TO-DATE
[   +4 ms] > Task :app:compileDebugShaders UP-TO-DATE
[   +1 ms] > Task :app:generateDebugAssets UP-TO-DATE
[   +2 ms] > Task :app:mergeDebugAssets
[+6399 ms] > Task :app:copyFlutterAssetsDebug
[   +4 ms] > Task :app:mainApkListPersistenceDebug UP-TO-DATE
[   +3 ms] > Task :app:generateDebugResValues UP-TO-DATE
[   +2 ms] > Task :app:generateDebugResources UP-TO-DATE
[  +76 ms] > Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
[ +502 ms] > Task :app:mergeDebugResources UP-TO-DATE
[   +5 ms] > Task :app:processDebugManifest UP-TO-DATE
[  +92 ms] > Task :app:processDebugResources UP-TO-DATE
[ +235 ms] > Task :app:compileDebugJavaWithJavac UP-TO-DATE
[  +16 ms] > Task :app:compileDebugSources UP-TO-DATE
[   +1 ms] > Task :app:processDebugJavaRes NO-SOURCE
[   +1 ms] > Task :app:mergeDebugJavaResource UP-TO-DATE
[   +2 ms] > Task :app:checkDebugDuplicateClasses UP-TO-DATE
[ +153 ms] > Task :app:transformClassesWithDexBuilderForDebug UP-TO-DATE
[   +7 ms] > Task :app:desugarDebugFileDependencies UP-TO-DATE
[  +81 ms] > Task :app:mergeExtDexDebug UP-TO-DATE
[ +298 ms] > Task :app:mergeDexDebug UP-TO-DATE
[  +20 ms] > Task :app:validateSigningDebug UP-TO-DATE
[  +12 ms] > Task :app:signingConfigWriterDebug UP-TO-DATE
[  +67 ms] > Task :app:mergeDebugJniLibFolders UP-TO-DATE
[   +2 ms] > Task :app:mergeDebugNativeLibs UP-TO-DATE
[ +369 ms] > Task :app:stripDebugDebugSymbols UP-TO-DATE
[   +3 ms] Compatible side by side NDK version was not found.
[   +3 ms] > Task :app:packageDebug UP-TO-DATE
[   +1 ms] > Task :app:assembleDebug UP-TO-DATE
[   +1 ms] BUILD SUCCESSFUL in 24s
[   +4 ms] 29 actionable tasks: 3 executed, 26 up-to-date
[ +784 ms] Running Gradle task 'assembleDebug'... (completed in 26.9s)
[ +803 ms] calculateSha: LocalDirectory:
'C:\Users\eyadb\AndroidStudioProjects\flutter_app\build\app\outputs\apk'/app.apk
[ +161 ms] calculateSha: reading file took 154us
[ +947 ms] calculateSha: computing sha took 942us
[  +17 ms] √ Built build\app\outputs\apk\debug\app-debug.apk.
[  +26 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree
C:\Users\eyadb\AndroidStudioProjects\flutter_app\build\app\outputs\apk\app.apk AndroidManifest.xml
[ +136 ms] Exit code 0 from: C:\Users\eyadb\AppData\Local\Android\sdk\build-tools\28.0.3\aapt dump xmltree
C:\Users\eyadb\AndroidStudioProjects\flutter_app\build\app\outputs\apk\app.apk AndroidManifest.xml
[   +4 ms] N: android=http://schemas.android.com/apk/res/android
             E: manifest (line=2)
               A: android:versionCode(0x0101021b)=(type 0x10)0x1
               A: android:versionName(0x0101021c)="1.0.0" (Raw: "1.0.0")
               A: android:compileSdkVersion(0x01010572)=(type 0x10)0x1c
               A: android:compileSdkVersionCodename(0x01010573)="9" (Raw: "9")
               A: package="com.example.flutterapp" (Raw: "com.example.flutterapp")
               A: platformBuildVersionCode=(type 0x10)0x1c
               A: platformBuildVersionName=(type 0x10)0x9
               E: uses-sdk (line=7)
                 A: android:minSdkVersion(0x0101020c)=(type 0x10)0x10
                 A: android:targetSdkVersion(0x01010270)=(type 0x10)0x1c
               E: uses-permission (line=14)
                 A: android:name(0x01010003)="android.permission.INTERNET" (Raw: "android.permission.INTERNET")
               E: application (line=22)
                 A: android:label(0x01010001)="flutterapp" (Raw: "flutterapp")
                 A: android:icon(0x01010002)=@0x7f080000
                 A: android:name(0x01010003)="io.flutter.app.FlutterApplication" (Raw:
                 "io.flutter.app.FlutterApplication")
                 A: android:debuggable(0x0101000f)=(type 0x12)0xffffffff
                 A: android:appComponentFactory(0x0101057a)="androidx.core.app.CoreComponentFactory" (Raw:
                 "androidx.core.app.CoreComponentFactory")
                 E: activity (line=28)
                   A: android:theme(0x01010000)=@0x7f0a0000
                   A: android:name(0x01010003)="com.example.flutterapp.MainActivity" (Raw:
                   "com.example.flutterapp.MainActivity")
                   A: android:launchMode(0x0101001d)=(type 0x10)0x1
                   A: android:configChanges(0x0101001f)=(type 0x11)0x40003fb4
                   A: android:windowSoftInputMode(0x0101022b)=(type 0x11)0x10
                   A: android:hardwareAccelerated(0x010102d3)=(type 0x12)0xffffffff
                   E: intent-filter (line=35)
                     E: action (line=36)
                       A: android:name(0x01010003)="android.intent.action.MAIN" (Raw: "android.intent.action.MAIN")
                     E: category (line=38)
                       A: android:name(0x01010003)="android.intent.category.LAUNCHER" (Raw:
                       "android.intent.category.LAUNCHER")
                 E: meta-data (line=45)
                   A: android:name(0x01010003)="flutterEmbedding" (Raw: "flutterEmbedding")
                   A: android:value(0x01010024)=(type 0x10)0x2
[   +4 ms] Stopping app 'app.apk' on ONEPLUS A5000.
[   +2 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 shell am
force-stop com.example.flutterapp
[ +169 ms] error: closed
[   +9 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 shell pm list
packages com.example.flutterapp
[  +56 ms] error: closed
[   +9 ms] ProcessException: Process exited abnormally:
           error: closed
             Command: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 shell pm list
             packages com.example.flutterapp
[   +1 ms] Installing APK.
[   +3 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe version
[  +50 ms] Android Debug Bridge version 1.0.41
           Version 29.0.6-6198805
           Installed as C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe
[   +3 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe start-server
[  +55 ms] Installing build\app\outputs\apk\app.apk...
[   +2 ms] executing: C:\Users\eyadb\AppData\Local\Android\sdk\platform-tools\adb.exe -s 127.0.0.1:5555 install -t -r
C:\Users\eyadb\AndroidStudioProjects\flutter_app\build\app\outputs\apk\app.apk
[  +67 ms] Performing Streamed Install

           adb: connect error for write: closed
[   +5 ms] Installing build\app\outputs\apk\app.apk... (completed in 0.1s)
[   +4 ms] Error: ADB exited with exit code 1
[   +5 ms] Performing Streamed Install

           adb: connect error for write: closed
[   +4 ms] Warning: Failed to install APK.
[   +1 ms] Error launching application on ONEPLUS A5000.
[   +6 ms] "flutter run" took 32,792ms.

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:509:7)
<asynchronous suspension>
#2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:615:18)
<asynchronous suspension>
#3      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:515:33)
<asynchronous suspension>
#4      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)
#5      _rootRun (dart:async/zone.dart:1126:13)
#6      _CustomZone.run (dart:async/zone.dart:1023:19)
#7      _runZoned (dart:async/zone.dart:1518:10)
#8      runZoned (dart:async/zone.dart:1465:12)
#9      AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#10     FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:505:20)
#11     CommandRunner.runCommand (package:args/command_runner.dart:197:27)
#12     FlutterCommandRunner.runCommand.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command_runner.dart:413:21)
<asynchronous suspension>
#13     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)
#14     _rootRun (dart:async/zone.dart:1126:13)
#15     _CustomZone.run (dart:async/zone.dart:1023:19)
#16     _runZoned (dart:async/zone.dart:1518:10)
#17     runZoned (dart:async/zone.dart:1465:12)
#18     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#19     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:19)
#20     CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:112:25)
#21     new Future.sync (dart:async/future.dart:224:31)
#22     CommandRunner.run (package:args/command_runner.dart:112:14)
#23     FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:250:18)
#24     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:63:22)
#25     _rootRun (dart:async/zone.dart:1126:13)
#26     _CustomZone.run (dart:async/zone.dart:1023:19)
#27     _runZoned (dart:async/zone.dart:1518:10)
#28     runZoned (dart:async/zone.dart:1502:12)
#29     run.<anonymous closure> (package:flutter_tools/runner.dart:61:18)
<asynchronous suspension>
#30     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:146:29)
#31     _rootRun (dart:async/zone.dart:1126:13)
#32     _CustomZone.run (dart:async/zone.dart:1023:19)
#33     _runZoned (dart:async/zone.dart:1518:10)
#34     runZoned (dart:async/zone.dart:1465:12)
#35     AppContext.run (package:flutter_tools/src/base/context.dart:145:18)
#36     runInContext (package:flutter_tools/src/context_runner.dart:64:24)
#37     run (package:flutter_tools/runner.dart:50:10)
#38     main (package:flutter_tools/executable.dart:65:9)
#39     main (file:///C:/b/s/w/ir/k/archive/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#40     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:305:32)
#41     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:174:12)

Команда flutter doctor -v показывает, что все в порядке:

[√] Flutter (Channel stable, v1.12.13+hotfix.9, on Microsoft Windows [Version 10.0.18363.418], locale en-US)
    • Flutter version 1.12.13+hotfix.9 at C:\flutter
    • Framework revision f139b11009 (2 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\eyadb\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: E:\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)
    • All Android licenses accepted.

[√] Android Studio (version 3.6)
    • Android Studio at E:\Android Studio
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b04)

[√] VS Code, 64-bit edition (version 1.43.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.9.1

[√] Connected device (1 available)
    • ONEPLUS A5000 • 127.0.0.1:5555 • android-x86 • Android 7.1.1 (API 25)

• No issues found!

Я читал много статей, которые я Я должен включить мост ADB от Bluestacks через Настройки, но, как вы можете видеть, у меня нет этой опции:

enter image description here

Я не понимаю, потому что все кажется хорошо. Как я могу решить проблему?

...