Hi! I need your help, guys.
I am trying to setup Flutter to learn it, and everything works except Emulator.
On Youtube I saw people to be able to run flutter App either Natively or as an Android/Ios Emulator, but for me only Natively works.
I could’ve gone by without it - but some features are only working on real device or emulator (Google Ads, Revenue Cat (Subscription service)) - So I need them to test the app, those are very important.
Here is my config, don’t ask about it - its a bit of a magic to me but it seems like its working…
let
#Add Android SDK setup
android-nixpkgs = pkgs.callPackage (import (builtins.fetchGit {
url = "https://github.com/tadfisher/android-nixpkgs.git";
})) {
channel = "stable";
};
# Create an Android SDK package with selected components
androidSdk = android-nixpkgs.sdk (sdkPkgs: with sdkPkgs; [
cmdline-tools-latest
build-tools-34-0-0
platform-tools
platforms-android-34
emulator
]);
in
Then, in packages:
(pkgs.androidenv.emulateApp {
name = "emulate-MyAndroidApp";
platformVersion = "VanillaIceCream";
abiVersion = "x86_64"; # armeabi-v7a, mips, x86_64
systemImageType = "google_apis_playstore";
})
androidSdk
And of course, I have accepted the licenses:
nixpkgs.config.allowUnfree = true;
nixpkgs.config.android_sdk.accept_license = true;
I also have setup paths in my bashrc
file:
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools
These all actions resulted in me successfully building and having my console output versions for these two commands, meaning they are present and working:
avdmanager --help
sdkmanager --version
And now, when VSCode prompts me to select a platform to build the app for - when I select “Create Emulator” option, it begins but quickly ends with such an error:
No suitable Android AVD system images are available. You may need to install these using sdkmanager, for example: sdkmanager "system-images;android-27;google_apis_playstore;x86"
and when I try to execute that command in my terminal, it results in this error:
Warning: Errors during XML parse:
Warning: Additionally, the fallback loader failed to parse the XML.
Warning: Failed to read or create install properties file.
[=== ] 10% Installing Google Play Intel x86 A
And I have no idea what to do now.
Can somebody help? Thanks