0
votes

I am trying to build flutter app in release mode. I tried to do flutter build appbundle in the terminal and i get the following error.

FAILURE: Build failed with an exception.
  • What went wrong: A problem occurred configuring root project 'sqflite'.

    SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/home/abdu/Downloads/flutter_linux_v1.12.13+hotfix.5-stable/flutter/.pub-cache/hosted/pub.dartlang.org/sqflite-1.3.0/android/local.properties'.

This is my first time building an app and I don't have no idea how to fix this. Any help would be appreciated. Thank you.

1

1 Answers

0
votes

try adding Android home path:

export ANDROID_HOME=$HOME/[folder if you have any]/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools

Add the above lines to the file ~/.bashrc (located at home/username/.bashrc) . Run source ~/.bashrc to apply the changes or restart your terminal..

to check

echo $ANDROID_HOME

..