I'm setting up a CI/CD pipeline on an ARM64 Ubuntu host and am trying to build a Flutter APK directly on this ARM64 Linux environment. However, I'm encountering some issues. Here’s a summary of what I’ve done so far and the problems I’m facing:
Issue
When running the following command to install necessary SDK components:
sdkmanager "platform-tools" "platforms;android-30" "build-tools;30.0.3"
I receive the following warnings:
Warning: This version only understands SDK XML versions up to 3 but an SDK XML file of version 4 was encountered. This can happen if you use versions of Android Studio and the command-line tools that were released at different times.Warning: Dependant package with key emulator not found!Warning: Unable to compute a complete list of dependencies.
Questions
- Is it possible to build a Flutter APK directly on an ARM64 Ubuntu host without using an emulator?
- Are there any additional steps or configurations required for building on ARM64 architecture?
- Could there be any specific issues with the ARM64 build process for Flutter that I should be aware of?
- How can I resolve the warnings about SDK XML version mismatch and missing dependencies?
I’m specifically setting this up for a CI/CD pipeline, so any tips on optimizing or resolving issues for this environment would be especially helpful.
Any insights or solutions would be greatly appreciated. Thanks in advance!
What I’ve Done
Installed Flutter from GitHub:
- Cloned the Flutter repository from GitHub.
- Followed the instructions to set it up.
- Note: The version downloaded directly from the Flutter website did not work on my ARM64 system; it seems to be an AMD64 binary. The GitHub version worked well for my ARM64 architecture.
Installed Command-Line Tools:
- Updated Ubuntu and installed necessary tools:
sudo apt updatesudo apt install unzip wget
- Downloaded and installed the Android command-line tools:
wget https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip -O commandlinetools.zipmkdir -p ~/Android/Sdk/cmdline-toolsunzip commandlinetools.zip -d ~/Android/Sdk/cmdline-toolsmv ~/Android/Sdk/cmdline-tools/cmdline-tools ~/Android/Sdk/cmdline-tools/latest
- Configured environment variables:
export ANDROID_SDK_ROOT=$HOME/Android/Sdkexport PATH=$PATH:$ANDROID_SDK_ROOT/cmdline-tools/latest/binexport PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools
- Updated Ubuntu and installed necessary tools:
System Information
- Flutter Version: 3.24.2
- Ubuntu Version: 22.04.5 LTS
- Architecture: aarch64