Mac m1 flutter project not running on Android device or emulator

2,253

Solution 1

Answered! Finally I found solution - just reseted android stiudio settings to defaults and downloaded plugins. See screenshot attachedenter image description here.

Solution 2

I had same issue on M1 MacBook with Flutter version v2.5.3 and I tried that way and it worked.

  1. Open your project's android folder with Android Studio
  2. Wait for Android Studio when it installs missing plugins and syncs Gradle.
  3. Open your project on VSCode, debug and have fun!
Share:
2,253
Michael Babozhko
Author by

Michael Babozhko

Updated on January 01, 2023

Comments

  • Michael Babozhko
    Michael Babozhko over 1 year

    I using Macbook Air M1. Simple flutter project. Trying to build the app for android device or emulator no mattaer through Android Studio or from terminal flutter return this message:

    Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
    Running Gradle task 'assembleDebug'...
    Exception: The flutter tool cannot access the file or directory.
    Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
    

    Trying chmod 777 for both projet and sdk folders did nothing.

    Flutter docor output:

    flutter doctor -v
    [✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-arm, locale
        en-IL)
        • Flutter version 2.5.3 at /Users/michaelbabozhko/Documents/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 18116933e7 (12 days ago), 2021-10-15 10:46:35 -0700
        • Engine revision d3ea636dc5
        • Dart version 2.14.4
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/michaelbabozhko/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 13.0, Build version 13A233
        • CocoaPods version 1.11.2
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 2020.3)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Flutter plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/9212-flutter
        • Dart plugin can be installed from:
          🔨 https://plugins.jetbrains.com/plugin/6351-dart
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    
    [✓] VS Code (version 1.61.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension can be installed from:
          🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
    
    [✓] Connected device (2 available)
        • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64  • Android 12
          (API 31) (emulator)
        • Chrome (web)                • chrome        • web-javascript • Google
          Chrome 94.0.4606.81
    
    • No issues found!
    
  • Michael Babozhko
    Michael Babozhko over 2 years
    Didn't help me. See my solution - it could help you to use only Android Studio.
  • Sébastien REMY
    Sébastien REMY over 2 years
    It's not working for me on iMac M1