Not able to run Flutter Project in Android Emulator or Android Physical Device

501

Android SDK path of my flutter was not defined.. Once I change my flutter android sdk path using below command

flutter config --android-sdk 'My SDK Path'

Everything works well.. Now I am able to run in android emulator.

Share:
501
Mani murugan
Author by

Mani murugan

Iphone developer in India

Updated on December 21, 2022

Comments

  • Mani murugan
    Mani murugan over 1 year

    I am using Android Studio in Mac. When I try to run my newly created sample flutter project in Android Emulator , I am getting below Error.

    Checking the license for package SDK Patch Applier v4 in /usr/local/Caskroom/android-platform-tools/29.0.5/licenses

    Warning: License for package SDK Patch Applier v4 not accepted.

    Checking the license for package Android Emulator in /usr/local/Caskroom/android-platform-tools/29.0.5/licenses

    Warning: License for package Android Emulator not accepted.

    Checking the license for package Android SDK Tools in /usr/local/Caskroom/android-platform-tools/29.0.5/licenses

    Warning: License for package Android SDK Tools not accepted.

    Checking the license for package Android SDK Build-Tools 28.0.3 in /usr/local/Caskroom/android-platform-tools/29.0.5/licenses

    Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.

    Checking the license for package Android SDK Platform 28 in /usr/local/Caskroom/android-platform-tools/29.0.5/licenses

    Warning: License for package Android SDK Platform 28 not accepted.

    FAILURE: Build failed with an exception.

    • What went wrong: Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.

      Failed to install the following Android SDK packages as some licences have not been accepted. patcher;v4 SDK Patch Applier v4 build-tools;28.0.3 Android SDK Build-Tools 28.0.3 emulator Android Emulator tools Android SDK Tools platforms;android-28 Android SDK Platform 28 To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager. Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

      Using Android SDK: /usr/local/Caskroom/android-platform-tools/29.0.5

    • 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.

    When I open android module from flutter project like this Image(Open Android Module in Android Studio),

    enter image description here

    Then New Android Studio window opened with Android Module of this sample project. I am able to run this android module project into emulator without any problem. I wonder why android studio is giving this error when I directly run from flutter project of same android module.

    Note : All license for all android SDK packages are accepted