AquaWallet / aqua-wallet

https://aquawallet.io
MIT License
78 stars 8 forks source link

Reproducible builds for Android APK #9

Open xrviv opened 7 months ago

xrviv commented 7 months ago

Hello, Danny here from WalletScrutiny, I'm currently trying to reproducible build the Android app.

I've taken the Dockerfile build approach to emulate as much as possible the original build process.

I would love to have your feedback:

# Use the latest official Flutter Docker image as the base image.
# This image comes with Dart, Flutter, and fvm pre-installed.
FROM cirrusci/flutter:latest

# Set the working directory in the Docker container
WORKDIR /app

# Clone the necessary repositories with the specific branches as mentioned
# Note: You may need to adjust the following git clone commands according to your actual requirements.
RUN git clone -b pset_stable https://github.com/sideswap-io/gdk.git && \
    git clone https://github.com/AquaWalletIO/rust-elements-wrapper.git

# Install dependencies for Android development, including Cmake and NDK.
# Note: This step assumes that sdkmanager is available. You might need to adjust paths and versions accordingly.
RUN yes | sdkmanager --licenses && \
    sdkmanager --install "ndk;21.4.7075529" "cmake;3.10.2.4988404"

# Assuming the app's source code is in the current directory, copy it into the container.
# Ensure that .dockerignore is set up to exclude unnecessary files.
COPY . .

# Set the correct Flutter version for the project using fvm.
RUN fvm use

# Run the make setup command as specified. This will require having a Makefile at your app's root.
# Ensure the Makefile is properly configured to run without user interaction.
RUN make setup

# Add a custom script or command to build the app. This is a placeholder for whatever build steps are needed.
# For example, to build an APK:
RUN fvm flutter build apk

# To keep the container running and allow for debugging, interactive sessions, or further commands.
CMD ["sleep", "infinity"]
aquawallet-admin commented 7 months ago

Hello, have not tested building it inside docker, but it should work.

Looking through the log, it looks like the commands are correct. Are you running into problems? Getting errors?

On a side note - we are working on reproducible builds + fdroid right now and should be available soon.

Giszmo commented 5 months ago

How is it going? I was poked to look into aqua reproducibility, too and wonder if there's any updated claims to reproducibility or if I should just try and see?

xrviv commented 5 months ago

Trying without docker

I was able to reach, right now.

fvm flutter run

image

Update:

$ fvm flutter run
Downloading android-arm-profile/linux-x64 tools...               2,380ms
Downloading android-arm-release/linux-x64 tools...               1,944ms
Downloading android-arm64-profile/linux-x64 tools...             1,758ms
Downloading android-arm64-release/linux-x64 tools...             1,529ms
Downloading android-x64-profile/linux-x64 tools...               1,768ms
Downloading android-x64-release/linux-x64 tools...               1,463ms
Downloading Web SDK...                                             13.2s
Downloading linux-x64-debug/linux-x64-flutter-gtk tools...          4.7s
Downloading linux-x64-profile/linux-x64-flutter-gtk tools...         3.5s
Downloading linux-x64-release/linux-x64-flutter-gtk tools...      2,913ms
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on sdk gphone x86 in debug mode...
[Aqua] Store file: /home/dannybuntu/work/builds/aquawallet-build/aqua-wallet/android/android_keys/keystore.jks
Checking the license for package NDK (Side by side) 23.1.7779620 in /opt/android-sdk/licenses
License for package NDK (Side by side) 23.1.7779620 accepted.
Preparing "Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)".
"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" ready.
Installing NDK (Side by side) 23.1.7779620 in /opt/android-sdk/ndk/23.1.7779620
"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" complete.
"Install NDK (Side by side) 23.1.7779620 (revision: 23.1.7779620)" finished.
Checking the license for package Android SDK Platform 28 in /opt/android-sdk/licenses
License for package Android SDK Platform 28 accepted.
Preparing "Install Android SDK Platform 28 (revision: 6)".
"Install Android SDK Platform 28 (revision: 6)" ready.
Installing Android SDK Platform 28 in /opt/android-sdk/platforms/android-28
"Install Android SDK Platform 28 (revision: 6)" complete.
"Install Android SDK Platform 28 (revision: 6)" finished.
lib/features/external/boltz/boltz_provider.dart:14:8: Error: Error when reading 'lib/common/crypto/generate_random_bytes.dart': No such file or directory
import 'package:aqua/common/crypto/generate_random_bytes.dart';
       ^
lib/features/external/boltz/boltz_provider.dart:15:8: Error: Error when reading 'lib/common/crypto/secp256k1_key_pair.dart': No such file or directory
import 'package:aqua/common/crypto/secp256k1_key_pair.dart';
       ^
lib/features/external/boltz/boltz_provider.dart:144:21: Error: The method 'secp256k1KeyPair' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'secp256k1KeyPair'.
    final keyPair = secp256k1KeyPair();
                    ^^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:145:27: Error: The method 'privateKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'privateKeyToHex'.
    final privateKeyHex = privateKeyToHex(keyPair.privateKey as ECPrivateKey);
                          ^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:146:26: Error: The method 'publicKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'publicKeyToHex'.
    final publicKeyHex = publicKeyToHex(keyPair.publicKey as ECPublicKey);
                         ^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:239:22: Error: The method 'generateRandom32Bytes' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'generateRandom32Bytes'.
    final preimage = generateRandom32Bytes();
                     ^^^^^^^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:245:21: Error: The method 'secp256k1KeyPair' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'secp256k1KeyPair'.
    final keyPair = secp256k1KeyPair();
                    ^^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:246:27: Error: The method 'privateKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'privateKeyToHex'.
    final privateKeyHex = privateKeyToHex(keyPair.privateKey as ECPrivateKey);
                          ^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:247:26: Error: The method 'publicKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'publicKeyToHex'.
    final publicKeyHex = publicKeyToHex(keyPair.publicKey as ECPublicKey);
                         ^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

* Where:
Script '/home/dannybuntu/fvm/versions/3.10.6/packages/flutter_tools/gradle/flutter.gradle' line: 1201

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/dannybuntu/fvm/versions/3.10.6/bin/flutter'' finished with non-zero exit value 1

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

* Get more help at https://help.gradle.org

BUILD FAILED in 10m 31s
Running Gradle task 'assembleDebug'...                            632.5s
Exception: Gradle task assembleDebug failed with exit code 1

Trying again

$ fvm flutter clean
Deleting build...                                                    7ms
Deleting .dart_tool...                                             197ms
Deleting Generated.xcconfig...                                       4ms
Deleting flutter_export_environment.sh...                            0ms
Deleting .flutter-plugins-dependencies...                            1ms
Deleting .flutter-plugins...                                         0ms

dannybuntu@z0:~/work/builds/aquawallet-build/aqua-wallet$ fvm flutter pub get
Resolving dependencies... (1.1s)
  _fe_analyzer_shared 60.0.0 (67.0.0 available)
  analyzer 5.12.0 (6.4.1 available)
  analyzer_plugin 0.11.2 (0.11.3 available)
  archive 3.4.9 (3.4.10 available)
  build_resolvers 2.4.1 (2.4.2 available)
  build_runner 2.4.7 (2.4.9 available)
  build_runner_core 7.2.11 (7.3.0 available)
  built_value 8.8.0 (8.9.2 available)
  cli_util 0.4.0 (0.4.1 available)
  code_builder 4.8.0 (4.10.0 available)
  collection 1.17.1 (1.18.0 available)
  coverage 1.6.4 (1.7.2 available)
  cross_file 0.3.3+7 (0.3.4+1 available)
  custom_lint 0.4.0 (0.6.4 available)
  custom_lint_builder 0.4.0 (0.6.4 available)
  custom_lint_core 0.4.0 (0.6.3 available)
  dart_style 2.3.2 (2.3.6 available)
  dio 5.4.0 (5.4.2+1 available)
  ffi 2.1.0 (2.1.2 available)
  ffigen 8.0.2 (11.0.0 available)
  file 6.1.4 (7.0.0 available)
  file_picker 5.5.0 (8.0.0+1 available)
  file_selector_platform_interface 2.6.1 (2.6.2 available)
  flutter_hooks 0.18.6 (0.20.5 available)
  flutter_inappwebview 5.8.0 (6.0.0 available)
  flutter_keyboard_visibility 5.4.1 (6.0.0 available)
  flutter_lints 2.0.3 (3.0.2 available)
  flutter_riverpod 2.4.9 (2.5.1 available)
  flutter_secure_storage 8.1.0 (9.0.0 available)
  flutter_secure_storage_windows 2.1.1 (3.0.0 available)
  flutter_svg 2.0.9 (2.0.10+1 available)
  freezed 2.4.1 (2.5.1 available)
  frontend_server_client 3.2.0 (4.0.0 available)
  google_fonts 5.1.0 (6.2.1 available)
  hooks_riverpod 2.4.9 (2.5.1 available)
  hotreloader 3.0.6 (4.2.0 available)
! http 0.13.6 (overridden) (1.2.1 available)
  image 4.1.3 (4.1.7 available)
  image_picker 1.0.4 (1.0.7 available)
  image_picker_android 0.8.8+2 (0.8.9+5 available)
  image_picker_for_web 3.0.1 (3.0.3 available)
  image_picker_ios 0.8.8+4 (0.8.9+2 available)
  image_picker_platform_interface 2.9.1 (2.10.0 available)
  intl 0.18.0 (0.19.0 available)
  isolator 1.1.0 (2.0.8 available)
  js 0.6.7 (0.7.1 available)
  lints 2.1.1 (3.0.0 available)
  logger 1.4.0 (2.2.0 available)
  lottie 2.6.0 (3.1.0 available)
  matcher 0.12.15 (0.12.16+1 available)
  material_color_utilities 0.2.0 (0.11.1 available)
  meta 1.9.1 (1.14.0 available)
  mime 1.0.4 (1.0.5 available)
  mobile_scanner 3.5.5 (4.0.1 available)
  mocktail 1.0.2 (1.0.3 available)
  package_info_plus 4.2.0 (7.0.0 available)
  package_info_plus_platform_interface 2.0.1 (3.0.0 available)
  path 1.8.3 (1.9.0 available)
  path_provider 2.1.1 (2.1.2 available)
  path_provider_android 2.2.1 (2.2.2 available)
  path_provider_foundation 2.3.1 (2.3.2 available)
  path_provider_platform_interface 2.1.1 (2.1.2 available)
  petitparser 5.4.0 (6.0.2 available)
  platform 3.1.3 (3.1.4 available)
  plugin_platform_interface 2.1.7 (2.1.8 available)
  pointycastle 3.7.3 (3.8.0 available)
  provider 6.1.1 (6.1.2 available)
  qr 2.1.0 (3.0.1 available)
  qr_flutter 4.0.0 (4.1.0 available)
  riverpod 2.4.9 (2.5.1 available)
  riverpod_analyzer_utils 0.3.1 (0.5.1 available)
  riverpod_annotation 2.3.3 (2.3.5 available)
  riverpod_generator 2.2.4 (2.4.0 available)
  riverpod_lint 1.4.0 (2.3.10 available)
  share_plus 7.2.1 (8.0.3 available)
  share_plus_platform_interface 3.3.1 (3.4.0 available)
  shared_preferences_foundation 2.3.4 (2.3.5 available)
  shared_preferences_platform_interface 2.3.1 (2.3.2 available)
  shared_preferences_web 2.2.1 (2.3.0 available)
  skeletonizer 0.4.0 (1.1.1 available)
  source_gen 1.4.0 (1.5.0 available)
  source_span 1.9.1 (1.10.0 available)
  stack_trace 1.11.0 (1.11.1 available)
  stream_channel 2.1.1 (2.1.2 available)
  test 1.24.1 (1.25.3 available)
  test_api 0.5.1 (0.7.1 available)
  test_core 0.5.1 (0.6.1 available)
  url_launcher 6.1.14 (6.2.5 available)
  url_launcher_android 6.2.0 (6.3.0 available)
  url_launcher_ios 6.2.1 (6.2.5 available)
  url_launcher_linux 3.1.0 (3.1.1 available)
  url_launcher_platform_interface 2.2.0 (2.3.2 available)
  url_launcher_web 2.0.19 (2.3.0 available)
  url_launcher_windows 3.1.0 (3.1.1 available)
  uuid 3.0.7 (4.4.0 available)
  vector_graphics 1.1.9+1 (1.1.11+1 available)
  vector_graphics_codec 1.1.9+1 (1.1.11+1 available)
  vector_graphics_compiler 1.1.9+1 (1.1.11+1 available)
  vm_service 11.10.0 (14.2.0 available)
  web_socket_channel 2.4.0 (2.4.5 available)
  webview_flutter 4.4.2 (4.7.0 available)
  webview_flutter_android 3.12.1 (3.16.0 available)
  webview_flutter_platform_interface 2.8.0 (2.10.0 available)
  webview_flutter_wkwebview 3.9.4 (3.13.0 available)
  win32 5.0.9 (5.4.0 available)
  xdg_directories 1.0.3 (1.0.4 available)
  xml 6.3.0 (6.5.0 available)
  yaml_edit 2.1.1 (2.2.0 available)
  youtube_player_flutter 8.1.2 (9.0.0 available)
Got dependencies!

dannybuntu@z0:~/work/builds/aquawallet-build/aqua-wallet$ fvm flutter run
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on sdk gphone x86 in debug mode...
[Aqua] Store file: /home/dannybuntu/work/builds/aquawallet-build/aqua-wallet/android/android_keys/keystore.jks
lib/features/external/boltz/boltz_provider.dart:14:8: Error: Error when reading 'lib/common/crypto/generate_random_bytes.dart': No such file or directory
import 'package:aqua/common/crypto/generate_random_bytes.dart';
       ^
lib/features/external/boltz/boltz_provider.dart:15:8: Error: Error when reading 'lib/common/crypto/secp256k1_key_pair.dart': No such file or directory
import 'package:aqua/common/crypto/secp256k1_key_pair.dart';
       ^
lib/features/external/boltz/boltz_provider.dart:144:21: Error: The method 'secp256k1KeyPair' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'secp256k1KeyPair'.
    final keyPair = secp256k1KeyPair();
                    ^^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:145:27: Error: The method 'privateKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'privateKeyToHex'.
    final privateKeyHex = privateKeyToHex(keyPair.privateKey as ECPrivateKey);
                          ^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:146:26: Error: The method 'publicKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'publicKeyToHex'.
    final publicKeyHex = publicKeyToHex(keyPair.publicKey as ECPublicKey);
                         ^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:239:22: Error: The method 'generateRandom32Bytes' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'generateRandom32Bytes'.
    final preimage = generateRandom32Bytes();
                     ^^^^^^^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:245:21: Error: The method 'secp256k1KeyPair' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'secp256k1KeyPair'.
    final keyPair = secp256k1KeyPair();
                    ^^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:246:27: Error: The method 'privateKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'privateKeyToHex'.
    final privateKeyHex = privateKeyToHex(keyPair.privateKey as ECPrivateKey);
                          ^^^^^^^^^^^^^^^
lib/features/external/boltz/boltz_provider.dart:247:26: Error: The method 'publicKeyToHex' isn't defined for the class 'BoltzService'.
 - 'BoltzService' is from 'package:aqua/features/external/boltz/boltz_provider.dart' ('lib/features/external/boltz/boltz_provider.dart').
Try correcting the name to the name of an existing method, or defining a method named 'publicKeyToHex'.
    final publicKeyHex = publicKeyToHex(keyPair.publicKey as ECPublicKey);
                         ^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

* Where:
Script '/home/dannybuntu/fvm/versions/3.10.6/packages/flutter_tools/gradle/flutter.gradle' line: 1201

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command '/home/dannybuntu/fvm/versions/3.10.6/bin/flutter'' finished with non-zero exit value 1

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

* Get more help at https://help.gradle.org

BUILD FAILED in 47s
Running Gradle task 'assembleDebug'...                             48.2s
Exception: Gradle task assembleDebug failed with exit code 1
aquawallet-admin commented 5 months ago

Did you run make setup ?

aquawallet-admin commented 5 months ago

https://github.com/AquaWallet/aqua-wallet/blob/main/DEVELOPMENT.md

xrviv commented 5 months ago

Yes, and yes.

I tried again: https://pastebin.com/q4hAssUY

aquawallet-admin commented 5 months ago

This was the result of an error on our part where we were not copying over some files to the public repo. This has been fixed. Could you do a git pull and try again?

xrviv commented 5 months ago

Will try again today.

So far, failed. https://pastebin.com/TimS6Dz7

I surmise this is the reason for Dockerfiles.

And another attempt

aquawallet-admin commented 5 months ago

The problem seems to be this:

 CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
    The C compiler

      "/opt/android-sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/clang"

    is not able to compile a simple test program.

    It fails with the following output:

      Change Dir: /home/dannybuntu/work/builds/aqua-wallet/android/app/.cxx/Debug/414y3k4a/arm64-v8a/CMakeFiles/CMakeTmp

      Run Build Command(s):/opt/android-sdk/cmake/3.10.2.4988404/bin/ninja cmTC_23129 && [1/2] Building C object CMakeFiles/cmTC_23129.dir/testCCompiler.c.o
      [2/2] Linking C executable cmTC_23129
      FAILED: cmTC_23129 
      : && /opt/android-sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/bin/clang --target=aarch64-none-linux-android27 --sysroot=/opt/android-sdk/ndk/23.1.7779620/toolchains/llvm/prebuilt/linux-x86_64/sysroot -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fexceptions  -O2 -g -DNDEBUG -Wl,--build-id=sha1 -Wl,--no-rosegment -Wl,--fatal-warnings -Qunused-arguments -Wl,--no-undefined  -Wl,--gc-sections -B/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/9 -B/snap/flutter/current/usr/lib/x86_64-linux-gnu -B/snap/flutter/current/lib/x86_64-linux-gnu -B/snap/flutter/current/usr/lib/ -L/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/9 -L/snap/flutter/current/usr/lib/x86_64-linux-gnu -L/snap/flutter/current/lib/x86_64-linux-gnu -L/snap/flutter/current/usr/lib/ -lblkid -lgcrypt -llzma -llz4 -lgpg-error -luuid -lpthread -ldl -lepoxy -lfontconfig -B/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/9 -B/snap/flutter/current/usr/lib/x86_64-linux-gnu -B/snap/flutter/current/lib/x86_64-linux-gnu -B/snap/flutter/current/usr/lib/ -L/snap/flutter/current/usr/lib/gcc/x86_64-linux-gnu/9 -L/snap/flutter/current/usr/lib/x86_64-linux-gnu -L/snap/flutter/current/lib/x86_64-linux-gnu -L/snap/flutter/current/usr/lib/ -lblkid -lgcrypt -llzma -llz4 -lgpg-error -luuid -lpthread -ldl -lepoxy -lfontconfig CMakeFiles/cmTC_23129.dir/testCCompiler.c.o -o cmTC_23129  -latomic -lm && :
      ld: error: --fix-cortex-a53-843419 is only supported on AArch64 targets
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      ninja: build stopped: subcommand failed.
aquawallet-admin commented 5 months ago

Can you upgrade the NDK version to 25. and see if it fixes the problem?

sdk-manager --install "ndk;25.2.9519653"

xrviv commented 5 months ago

Installed NDK 25.2.9519653,

and edited local.properties

$ fvm flutter run
Using hardware rendering with device sdk gphone x86. If you notice graphics artifacts, consider enabling software rendering with "--enable-software-rendering".
Launching lib/main.dart on sdk gphone x86 in debug mode...
[Aqua] Store file: /home/dannybuntu/work/builds/aqua-wallet/android/android_keys/keystore.jks
[CXX1104] NDK from ndk.dir at /opt/android-sdk/ndk/25.2.9519653 had version [25.2.9519653] which disagrees with android.ndkVersion [23.1.7779620]
[CXX1104] NDK from ndk.dir at /opt/android-sdk/ndk/25.2.9519653 had version [25.2.9519653] which disagrees with android.ndkVersion [23.1.7779620]
[CXX1104] NDK from ndk.dir at /opt/android-sdk/ndk/25.2.9519653 had version [25.2.9519653] which disagrees with android.ndkVersion [23.1.7779620]

FAILURE: Build failed with an exception.

* Where:
Build file '/home/dannybuntu/work/builds/aqua-wallet/android/build.gradle' line: 26

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > com.android.builder.errors.EvalIssueException: [CXX1104] NDK from ndk.dir at /opt/android-sdk/ndk/25.2.9519653 had version [25.2.9519653] which disagrees with android.ndkVersion [23.1.7779620]

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

* Get more help at https://help.gradle.org

BUILD FAILED in 1s
Running Gradle task 'assembleDebug'...                           2,370ms
Exception: Gradle task assembleDebug failed with exit code 1
aquawallet-admin commented 5 months ago

Arite. Please wait a week or so while we get the fdroid build out and we can provide better instructions for building on a linux.

Right now, all our developers are using mac for the builds and it looks like there are some quirks with building on ubuntu.

Giszmo commented 5 months ago

Where can we track fdroid progress? I see no issue or branch for this here or there. Maybe we can help?

aquawallet-admin commented 5 months ago

This is just tracked internally right now. We will have more updates in the coming week with the "Bravo" release that is waiting for AppStore approval right now.

aquawallet-admin commented 5 months ago

Our attempt for the f-droid build https://gitlab.com/aquawallet/fdroiddata/-/pipelines

Its a work in progress; as you can see the build is failing right now. If you have any input, let us know :-)

Giszmo commented 5 months ago

I had a look but I don't see any logs or details. Have a link to what failed? I'm not familiar with the gitlab pipelines.

aquawallet-admin commented 5 months ago

logs are here https://gitlab.com/aquawallet/fdroiddata/-/jobs/6700129652

seems like (some?) flutter dependencies are not being picked up.

xrviv commented 5 months ago

Great. I thought it was just me...

xrviv commented 4 months ago

Any updates?

keraliss commented 1 month ago

Tried to create a dockerfile with the provided instruction,

# Use a base image with Nix and Flutter pre-installed
FROM nixos/nix:2.16.1 as builder

# Install required packages and tools
RUN nix-env -iA nixpkgs.bash nixpkgs.git nixpkgs.curl nixpkgs.flutter nixpkgs.util-linux nixpkgs.gnupg nixpkgs.yarn

# Set the working directory
WORKDIR /app

# Clone the Aqua Wallet repository
RUN git clone https://github.com/AquaWallet/aqua-wallet.git .

# Configure Git
RUN git config --global http.postBuffer 524288000

# Run 'make setup' to pull all dependencies and pre-built binaries for GDK and boltz-rust
RUN nix develop --experimental-features 'nix-command flakes' --command /bin/bash -c "make setup"

# Build the APK
RUN nix develop --experimental-features 'nix-command flakes' --command /bin/bash -c "flutter build apk --release"

# Use a minimal image to copy the built APK
FROM alpine:latest

# Create output directory
RUN mkdir -p /home/keraliss/projects/walletScrutiny_build/aqua

# Copy the generated APK from the builder stage
COPY --from=builder /app/build/app/outputs/flutter-apk/app-release.apk /home/keraliss/projects/walletScrutiny_build/aqua/

# Final command
CMD ["/bin/sh"]

But kept constantly getting error regarding make setup and was unable to resolve. You can find my detailed review here

Would highly appreciate if you can let us know how you guys build the apk, so we can replicate the same steps!