[英]Flutter: Execution failed for task ':app:compileDebugKotlin'
[英]flutter hello_world project: execution failed for task ':app:compileDebugKotlin'
我嘗試在我的 android 虛擬設備上從 flutter create 運行 hello_world flutter 應用程序,但它拋出了一個錯誤。 怎么了?
腳步:
> flutter run
Using hardware rendering with device AOSP on IA Emulator. If you get graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on AOSP on IA Emulator in debug mode...
e: /Users/kernelpanic/Desktop/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (4, 19): Unresolved reference: embedding
e: /Users/kernelpanic/Desktop/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (5, 19): Unresolved reference: embedding
e: /Users/kernelpanic/Desktop/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (8, 21): Unresolved reference: FlutterActivity
e: /Users/kernelpanic/Desktop/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (9, 5): 'configureFlutterEngine' overrides nothing
e: /Users/kernelpanic/Desktop/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (9, 65): Unresolved reference: FlutterEngine
e: /Users/kernelpanic/Desktop/hello_world/android/app/src/main/kotlin/com/example/hello_world/MainActivity.kt: (10, 35): Cannot access class 'FlutterEngine'. Check your module classpath for missing or conflicting dependencies
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 2,4s
Gradle task assembleDebug failed with exit code 1
撲醫生:
> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.14.6 18G103, locale it-IT)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Community Edition (version 2019.3.1)
[✓] VS Code (version 1.43.0)
[✓] Connected device (1 available)
• No issues found!
清理 gradle 緩存,一切開始工作
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.