diff --git a/.docker/android-sdk.dockerfile b/.docker/android-sdk.dockerfile index 91d2291c80..2f28e09cf9 100644 --- a/.docker/android-sdk.dockerfile +++ b/.docker/android-sdk.dockerfile @@ -26,11 +26,11 @@ ENV ANDROID_SDK_ROOT=$ANDROID_HOME \ ENV ANDROID_SDK_TOOLS_VERSION=11076708 # https://developer.android.com/studio/releases/build-tools -ENV ANDROID_PLATFORM_VERSION=35 +ENV ANDROID_PLATFORM_VERSION=36 ENV ANDROID_BUILD_TOOLS_VERSION=35.0.1 # https://developer.android.com/ndk/downloads -ENV ANDROID_NDK_VERSION=27.2.12479018 +ENV ANDROID_NDK_VERSION=27.3.13750724 RUN set -o xtrace \ && sudo chown -R $USER:$USER /opt \ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index d71047787f..3e781fbad9 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip +distributionSha256Sum=8fad3d78296ca518113f3d29016617c7f9367dc005f932bd9d93bf45ba46072b +distributionUrl=https\://services.gradle.org/distributions/gradle-9.0.0-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/android/settings.gradle b/android/settings.gradle index 095777b4e3..d9923f9381 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -19,12 +19,14 @@ pluginManagement { plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" // Gradle plugin version https://developer.android.com/build/releases/gradle-plugin - id "com.android.application" version "8.8.0" apply false - // START: FlutterFire Configuration - id "com.google.gms.google-services" version "4.3.15" apply false + // 8.13 and above requires a build target of 35 or higher, and at least one of + // our dependencies is currently targeting 34: file_picker + id "com.android.application" version "8.11.1" apply false + // START: FlutterFire Configuration + id "com.google.gms.google-services" version "4.3.15" apply false // END: FlutterFire Configuration // Kotlin release with JVM 21 support: https://kotlinlang.org/docs/releases.html#release-details - id "org.jetbrains.kotlin.android" version "2.1.10" apply false + id "org.jetbrains.kotlin.android" version "2.2.10" apply false } include ":app" \ No newline at end of file diff --git a/docs/BUILD_RUN_APP.md b/docs/BUILD_RUN_APP.md index 68332e4c24..3767737663 100644 --- a/docs/BUILD_RUN_APP.md +++ b/docs/BUILD_RUN_APP.md @@ -30,6 +30,57 @@ flutter build ios ---- +## Ruby setup + +On macOS, Ruby is required for CocoaPods and Xcode tooling. Install Ruby 3.0+ (recommended: 3.4.x) using one of these version managers: + +- rbenv (recommended): lightweight, uses shims. Install via Homebrew and ruby-build. + + ```bash + brew install rbenv + rbenv init # detects current shell and adds init command to shell config + source ~/.zshrc || source ~/.bash_profile + rbenv install 3.4.5 + rbenv global 3.4.5 + ruby -v + ``` + +- RVM: full-featured manager with gemsets. + + ```bash + \curl -sSL https://get.rvm.io | bash -s stable --ruby + rvm install 3.4.5 + rvm use 3.4.5 --default + ruby -v + ``` + +- chruby (with ruby-install): minimal, simple switching. + + ```bash + brew install chruby ruby-install + echo 'source /opt/homebrew/opt/chruby/share/chruby/chruby.sh' >> ~/.zshrc + echo 'source /opt/homebrew/opt/chruby/share/chruby/auto.sh' >> ~/.zshrc + source ~/.zshrc + ruby-install ruby 3.4.5 + chruby 3.4.5 + ruby -v + ``` + +You may also use alternatives like asdf or mise; ensure Ruby 3.0+. + +## CocoaPods installation + +CocoaPods 1.15+ is required for iOS/macOS builds with the latest Xcode. + +NOTE: preferably do not install CocoaPods using `sudo`, as it may lead to permission issues. + +```bash +gem install cocoapods +pod --version +``` + +If you installed Ruby via a version manager, ensure the selected Ruby is active in your shell before installing CocoaPods. + ## Target platforms ### Web @@ -65,6 +116,8 @@ flutter run -d web-server --web-port=8080 In order to build for macOS, you need to use a macOS host. +Prerequisites (macOS): Ensure Ruby 3.0+ and CocoaPods 1.15+ are installed. See [Ruby setup](#ruby-setup) and [CocoaPods installation](#cocoapods-installation). + Before you begin: 1. Open `macos/Runner.xcworkspace` in XCode @@ -277,6 +330,8 @@ flutter build appbundle In order to build for iOS/iPadOS, you need to use a macOS host (Apple silicon recommended) Physical iPhone or iPad required, simulators are not yet supported. +Prerequisites (macOS): Ensure Ruby 3.0+ and CocoaPods 1.15+ are installed. See [Ruby setup](#ruby-setup) and [CocoaPods installation](#cocoapods-installation). + 1. `flutter clean` 2. `flutter pub get` 3. Connect your device to your Mac with a USB cable diff --git a/docs/PROJECT_SETUP.md b/docs/PROJECT_SETUP.md index 596ee7ff26..2073b564f9 100644 --- a/docs/PROJECT_SETUP.md +++ b/docs/PROJECT_SETUP.md @@ -13,38 +13,40 @@ Komodo Wallet is a cross-platform application, meaning it can be built for multi 1. [Install Flutter, pin Flutter version](INSTALL_FLUTTER.md) 2. Install IDEs - [VS Code](https://code.visualstudio.com/) - - install and enable `Dart` and `Flutter` extensions - - enable `Dart: Use recommended settings` via the Command Pallette - - [Android Studio](https://developer.android.com/studio) - Ladybug | 2024.2.2 - - install and enable `Dart` and `Flutter` plugins - - SDK Manager -> SDK Tools: - - [x] Android SDK Build-Tools - (latest) 35.0.1 - - [x] NDK (Side by side) - (latest) 28.0 - - [x] Android command line tools - (latest) 19.0.0 - - [x] CMake - (latest) 3.31.5 - - [xCode](https://developer.apple.com/xcode/) | 16.2 (macOS only) - - [Visual Studio](https://visualstudio.microsoft.com/vs/community/) | Community 17.13.0 (Windows only) + - Install and enable `Dart` and `Flutter` extensions + - Enable `Dart: Use recommended settings` via the Command Palette + - [Android Studio](https://developer.android.com/studio) + - Install and enable `Dart` and `Flutter` plugins + - Ensure that the following tools are installed and updated in SDK Manager -> SDK Tools: + - Android SDK Build-Tools + - NDK (Side by side) + - Android command line tools + - CMake + - (macOS only) [xCode](https://developer.apple.com/xcode/) + - (Windows only) [Visual Studio](https://visualstudio.microsoft.com/vs/community/) - `Desktop development with C++` workload required - [Nuget CLI](https://www.nuget.org/downloads) required for Windows desktop builds - [Enable long paths in Windows registry](BUILD_RUN_APP.md#windows-desktop) - - 3. Run `flutter doctor` and make sure all checks (except version) pass - 4. [Clone project repository](CLONE_REPOSITORY.md) - 5. **Initialize SDK submodule**: After cloning, initialize the komodo-defi-sdk-flutter submodule: + 3. (macOS only) CocoaPods and Ruby setup: + - Ruby: 3.0+ (recommended: 3.4.x). See [Ruby setup](BUILD_RUN_APP.md#ruby-setup). + - CocoaPods: 1.15+ (assuming latest Xcode). See [CocoaPods installation](BUILD_RUN_APP.md#cocoapods-installation). + 4. Run `flutter doctor` and make sure all checks (except version) pass + 5. [Clone project repository](CLONE_REPOSITORY.md) + 6. **Initialize SDK submodule**: After cloning, initialize the komodo-defi-sdk-flutter submodule: ```bash cd komodo-wallet git submodule update --init --recursive ``` - 6. Build and run the App for each target platform: + 7. Build and run the App for each target platform: - [Web](BUILD_RUN_APP.md#web) - [Android mobile](BUILD_RUN_APP.md#android) - [iOS mobile](BUILD_RUN_APP.md#ios) (macOS host only) - [macOS desktop](BUILD_RUN_APP.md#macos-desktop) (macOS host only) - [Windows desktop](BUILD_RUN_APP.md#windows-desktop) (Windows host only) - [Linux desktop](BUILD_RUN_APP.md#linux-desktop) (Linux host only) - 7. [Build release version](BUILD_RELEASE.md) + 8. [Build release version](BUILD_RELEASE.md) ## Dev Container setup (Web and Android builds only) @@ -52,8 +54,8 @@ Komodo Wallet is a cross-platform application, meaning it can be built for multi - Linux: Install [Docker for your distribution](https://docs.docker.com/install/#supported-platforms) and add your user to the group by using terminal to run: `sudo usermod -aG docker $USER`. - Windows/macOS: Install [Docker Desktop for Windows/macOS](https://www.docker.com/products/docker-desktop), and if you are using WSL in Windows, please ensure that the [WSL 2 back-end](https://aka.ms/vscode-remote/containers/docker-wsl2) is installed and configured. 2. Install [VS Code](https://code.visualstudio.com/) - - install and enable `Dart` and `Flutter` extensions - - enable `Dart: Use recommended settings` via the Command Pallette + - Install and enable `Dart` and `Flutter` extensions + - Enable `Dart: Use recommended settings` via the Command Palette 3. Install the VSCode [Dev Container extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) 4. Open the command palette (Ctrl+Shift+P) and run `Remote-Containers: Reopen in Container` @@ -72,7 +74,7 @@ export GITHUB_API_PUBLIC_READONLY_TOKEN= Example of the 403 error message (more likely after multiple repeated builds): ```bash -test@test komodo-wallet % flutter build web +test@test komodo-wallet % flutter build web Expected to find fonts for (MaterialIcons, packages/komodo_ui_kit/Custom, packages/cupertino_icons/CupertinoIcons), but found (MaterialIcons, packages/komodo_ui_kit/Custom). This usually means you are referring to font families in an IconData class but not including them in the assets section of your pubspec.yaml, are missing the package that would include them, or are missing "uses-material-design: true".