1 year ago

#366273

test-img

jay lee

Flutter not working with Android Emulator on Mac m1

I keep banging my head on the wall to figure out what went wrong. This is the output window when I created a new project and ran with an android-arm64 emulator.(BTW executing the same code with IOS emulator works fine)

[ +100 ms] > Task :app:processDebugMainManifest FAILED
[   +1 ms] FAILURE: Build failed with an exception.
[   +7 ms] * What went wrong:
[        ] Execution failed for task ':app:processDebugMainManifest'.
[        ] > Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @bef3762
[        ] * 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 3s
[        ] Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
[        ] Use '--warning-mode all' to show the individual deprecation warnings.
[        ] See https://docs.gradle.org/6.7/userguide/command_line_interface.html#sec:command_line_warnings
[        ] 13 actionable tasks: 5 executed, 8 up-to-date
[ +472 ms] Running Gradle task 'assembleDebug'... (completed in 4.6s)
[  +20 ms] Exception: Gradle task assembleDebug failed with exit code 1
[   +5 ms] "flutter run" took 26,258ms.
[   +7 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>
           
           
[ +150 ms] ensureAnalyticsSent: 145ms

My java version

openjdk version "18" 2022-03-22
OpenJDK Runtime Environment Homebrew (build 18+0)
OpenJDK 64-Bit Server VM Homebrew (build 18+0, mixed mode, sharing)

Flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.10.3, on macOS 12.3.1 21E258 darwin-arm, locale
    en-AU)
[✓] Android toolchain - develop for Android devices (Android SDK version
    33.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 13.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.1)
[!] Android Studio
    ✗ Android Studio not found at /Users/tomi/Library/Android/sdk/Contents
[✓] VS Code (version 1.66.0)
[✓] Connected device (3 available)
[✓] HTTP Host Availability

! Doctor found issues in 1 category.

Any advice would appreciate. Please shed some light on this.

flutter

macos

android-emulator

apple-m1

0 Answers

Your Answer

Accepted video resources