Open Giszmo opened 9 months ago
@Giszmo Thanks for bringing this to my attention. I will make it a priority to resolve this.
We strive for top-notch developer experience (DevEx) at Komodo so thanks for sharing your feedback.
Please see below for the tagged 0.9.0
release. I'm looking into the reported issue about documenting CLI build process this week.
0.9.0
GitHub Release@CharlVS I need assistance with the CLI build process to reproduce the wallet build. Could you kindly help with this?
@Shourya742 please share your console output and any other information you can provide.
If you have Flutter setup, please also do flutter doctor -v
in your terminal and share the output.
@CharlVS I don't have the Flutter setup on my local machine; instead, I am trying to build the application using a container. I followed the commands provided in the Project Setup guide: https://github.com/KomodoPlatform/komodo-wallet-mobile/wiki/Project-Setup#build-and-run
Hello @CharlVS I encountered an error while attempting to build the APK for our project using the Flutter command within a Docker environment. Below is the error output:
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... 16.1s
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety
Running Gradle task 'assembleRelease'...
.dart_tool/flutter_build/generated_main.dart:13:8: Error: Error when reading '/root/.pub-cache/git/dargon2-d11f51cab560acf7644ebef402f1996b6f320365/dargon2_flutter/dargon2_flutter_mobile/lib/dargon2_flutter_mobile.dart': No such file or directory
import 'package:dargon2_flutter_mobile/dargon2_flutter_mobile.dart';
^
.dart_tool/flutter_build/generated_main.dart:17:8: Error: Error when reading '/root/.pub-cache/git/dargon2-d11f51cab560acf7644ebef402f1996b6f320365/dargon2_flutter/dargon2_flutter_mobile/lib/dargon2_flutter_mobile.dart': No such file or directory
import 'package:dargon2_flutter_mobile/dargon2_flutter_mobile.dart';
^
.dart_tool/flutter_build/generated_main.dart:14:8: Error: Error when reading '/root/.pub-cache/hosted/pub.dartlang.org/path_provider_android-2.0.12/lib/path_provider_android.dart': No such file or directory
import 'package:path_provider_android/path_provider_android.dart';
^
^
lib/model/addressbook_provider.dart:5:8: Error: Error when reading '/root/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/lib/shared_preferences.dart': No such file or directory
import 'package:shared_preferences/shared_preferences.dart';
^
lib/model/cex_provider.dart:9:8: Error: Error when reading '/root/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/lib/shared_preferences.dart': No such file or directory
import 'package:shared_preferences/shared_preferences.dart';
^
lib/model/feed_provider.dart:10:8: Error: Error when reading '/root/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/lib/shared_preferences.dart': No such file or directory
import 'package:shared_preferences/shared_preferences.dart';
^
lib/model/swap_provider.dart:8:8: Error: Error when reading '/root/.pub-cache/hosted/pub.dartlang.org/shared_preferences-2.0.15/lib/shared_preferences.dart': No such file or directory
/sdks/flutter/packages/flutter/lib/src/widgets/container.dart:352:9: Error: Type 'Matrix4' not found.
final Matrix4? transform;
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/implicit_animations.dart:166:34: Error: Type 'Matrix4' not found.
class Matrix4Tween extends Tween<Matrix4> {
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/implicit_animations.dart:172:18: Error: Type 'Matrix4' not found.
Matrix4Tween({ Matrix4? begin, Matrix4? end }) : super(begin: begin, end: end);
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/implicit_animations.dart:172:34: Error: Type 'Matrix4' not found.
Matrix4Tween({ Matrix4? begin, Matrix4? end }) : super(begin: begin, end: end);
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/implicit_animations.dart:175:3: Error: Type 'Matrix4' not found.
Matrix4 lerp(double t) {
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/implicit_animations.dart:688:9: Error: Type 'Matrix4' not found.
final Matrix4? transform;
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:23:80: Error: Type 'Quad' not found.
typedef InteractiveViewerWidgetBuilder = Widget Function(BuildContext context, Quad viewport);
^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:360:10: Error: Type 'Vector3' not found.
static Vector3 getNearestPointOnLine(Vector3 point, Vector3 l1, Vector3 l2) {
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:360:40: Error: Type 'Vector3' not found.
static Vector3 getNearestPointOnLine(Vector3 point, Vector3 l1, Vector3 l2) {
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:360:55: Error: Type 'Vector3' not found.
static Vector3 getNearestPointOnLine(Vector3 point, Vector3 l1, Vector3 l2) {
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:360:67: Error: Type 'Vector3' not found.
static Vector3 getNearestPointOnLine(Vector3 point, Vector3 l1, Vector3 l2) {
^^^^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:379:10: Error: Type 'Quad' not found.
static Quad getAxisAlignedBoundingBox(Quad quad) {
^^^^
/sdks/flutter/packages/flutter/lib/src/widgets/interactive_viewer.dart:379:41: Error: Type 'Quad' not found.
static Quad getAxisAlignedBoundingBox(Quad quad) {
Rational newAmount;
^^^^^^^^
lib/model/swap_constructor_provider.dart:188:19: Error: The getter 'Rational' isn't defined for the class 'ConstructorProvider'.
- 'ConstructorProvider' is from 'package:komodo_dex/model/swap_constructor_provider.dart' ('lib/model/swap_constructor_provider.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Rational'.
newAmount = Rational.parse(newText);
^^^^^^^^
lib/model/swap_constructor_provider.dart:207:5: Error: 'Rational' isn't a type.
Rational newAmount;
^^^^^^^^
lib/model/swap_constructor_provider.dart:209:19: Error: The getter 'Rational' isn't defined for the class 'ConstructorProvider'.
- 'ConstructorProvider' is from 'package:komodo_dex/model/swap_constructor_provider.dart' ('lib/model/swap_constructor_provider.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Rational'.
newAmount = Rational.parse(newText);
^^^^^^^^
lib/model/swap_constructor_provider.dart:229:5: Error: 'Rational' isn't a type.
Rational amount;
^^^^^^^^
lib/model/swap_constructor_provider.dart:302:11: Error: 'Rational' isn't a type.
final Rational price = _matchingOrder.action == Market.SELL
^^^^^^^^
lib/model/swap_constructor_provider.dart:305:11: Error: 'Rational' isn't a type.
final Rational volume = _buyAmount;
^^^^^^^^
lib/model/swap_constructor_provider.dart:463:13: Error: 'Rational' isn't a type.
final Rational minOrderVolume = _matchingOrder.minVolume;
^^^^^^^^
lib/model/swap_constructor_provider.dart:468:15: Error: 'Rational' isn't a type.
final Rational price = _matchingOrder.action == Market.SELL
^^^^^^^^
lib/model/swap_constructor_provider.dart:471:15: Error: 'Rational' isn't a type.
final Rational minSellVolume = minOrderVolume / price;
^^^^^^^^
lib/model/swap_provider.dart:150:3: Error: 'SharedPreferences' isn't a type.
SharedPreferences _prefs;
^^^^^^^^^^^^^^^^^
lib/screens/dex/trade/pro/create/receive/matching_bids_table.dart:285:11: Error: 'Rational' isn't a type.
final Rational maxSellAmt = swapBloc.maxTakerVolume ??
^^^^^^^^
lib/screens/dex/trade/pro/create/receive/matching_bids_table.dart:286:9: Error: The getter 'Rational' isn't defined for the class '_MatchingBidsTableState'.
- '_MatchingBidsTableState' is from 'package:komodo_dex/screens/dex/trade/pro/create/receive/matching_bids_table.dart' ('lib/screens/dex/trade/pro/create/receive/matching_bids_table.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Rational'.
Rational.parse(swapBloc.sellCoinBalance.balance.balance.toString());
^^^^^^^^
lib/screens/dex/trade/pro/create/receive/bid_details_dialog.dart:56:36: Error: Undefined name 'SharedPreferences'.
(await SharedPreferences.getInstance()).setBool(
^^^^^^^^^^^^^^^^^
FAILURE: Build failed with an exception.
* Where:
Script '/sdks/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1070
* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/sdks/flutter/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 13s
Running Gradle task 'assembleRelease'... 13.5s
Gradle task assembleRelease failed with exit code 1
STEPS TO reproduce: Dockerfile:
FROM cirrusci/flutter:2.8.0
ARG TAG
WORKDIR /mnt
RUN if [ -z "$TAG" ]; then echo "TAG argument must be provided" && exit 1; fi
RUN git clone --branch v$TAG https://github.com/KomodoPlatform/komodo-wallet-mobile.git;
WORKDIR /mnt/komodo-wallet-mobile
CMD ["flutter", "build", "apk"]
Commands to follow:
Build Image: docker build -t komodo --build-arg TAG=0.9.1 .
Run container: docker run -it --rm komodo
Please add the API builds for libmm2.a
@Shourya742 We're working on the Docker builds and will have that ready for you to test tomorrow.
Do you want us to include building the API (libmm2.a
) binary when building the app or is it preferred to simply fetch from the public GitHub releases: https://github.com/KomodoPlatform/komodo-defi-framework/releases
@CharlVS fetching makes more sense.. Thanks for this.
If the wallet is split into a library and frontend, both should be reproducible so ideally, yes, we would prefer to also reproduce the library for the purpose of WalletScrutiny.com. We do not build all widely used libraries but this one being controlled by the same provider is clearly of interest.
At some point in the future we might get a better grasp of reproducibility of dependencies to split this but for now, if you could please provide a script that builds all artifacts that would be nice.
@Giszmo, we have docker files for the API artefact here, so I can look into that for you.
For the current iteration, we've set up the containers to fetch from the GitHub releases. As of a few hours ago, they're finalised and ready for you and @Shourya742 to test out here. My concern for your review process of building the API artefact from the source is that the binary is built in a non-deterministic way. Hashes won't match and sometimes even vary in size slightly. NB that the container will only run successfully on an x86 machine. ARM support will be added in a future release.
If the above is a consideration and you want to compare it to the Play Store APK, please wait until we push a new build within the next week. Previous API artefact releases have had our OPSEC team build the artefacts locally, and then GitHub releases were built from a CI container.
Please let me know if you encounter any snags or if there's anything we can do to assist with the review process.
@Giszmo We're working on adding the artefact compilation to the container. JFYI in case you'd prefer to wait for that to be ready before your review.
I'll wait. Thanks for the effort.
@Giszmo, we've got the container set up with PR #147 to build our API artefact and mobile APK. This is an update to show there's progress, so I recommend waiting for it to be merged before proceeding. However, depending on our QA and OPSEC team's availability/priorities, that may still be at least a week or two.
Hello team Komodo Platform!
Danny here, also from walletscrutiny.
I was able to build 0.9.1.
If, it is approved, it has a verdict of nonverifiable.
The diffs:
Diff:
Files /tmp/fromPlay_com.komodoplatform.atomicdex_105/AndroidManifest.xml and /tmp/fromBuild_com.komodoplatform.atomicdex_105/AndroidManifest.xml differ
Files /tmp/fromPlay_com.komodoplatform.atomicdex_105/assets/flutter_assets/AssetManifest.json and /tmp/fromBuild_com.komodoplatform.atomicdex_105/assets/flutter_assets/AssetManifest.json differ
Only in /tmp/fromBuild_com.komodoplatform.atomicdex_105/assets/flutter_assets/assets: coins_config.json
Files /tmp/fromPlay_com.komodoplatform.atomicdex_105/assets/flutter_assets/assets/coins.json and /tmp/fromBuild_com.komodoplatform.atomicdex_105/assets/flutter_assets/assets/coins.json differ
Files /tmp/fromPlay_com.komodoplatform.atomicdex_105/assets/flutter_assets/NOTICES.Z and /tmp/fromBuild_com.komodoplatform.atomicdex_105/assets/flutter_assets/NOTICES.Z differ
Files /tmp/fromPlay_com.komodoplatform.atomicdex_105/classes2.dex and /tmp/fromBuild_com.komodoplatform.atomicdex_105/classes2.dex differ
Files /tmp/fromPlay_com.komodoplatform.atomicdex_105/classes.dex and /tmp/fromBuild_com.komodoplatform.atomicdex_105/classes.dex differ
Files /tmp/fromPlay_com.komodoplatform.atomicdex_105/resources.arsc and /tmp/fromBuild_com.komodoplatform.atomicdex_105/resources.arsc differ
Only in /tmp/fromPlay_com.komodoplatform.atomicdex_105: stamp-cert-sha256
For your reference, I have included the dockerfile and the script I used.
FROM ubuntu:20.04
ENV DEBIAN_FRONTEND=noninteractive
ENV FLUTTER_VERSION=2.8.1
ENV FLUTTER_HOME=/home/developer/flutter
ENV ANDROID_SDK_ROOT=/opt/android-sdk
ENV PATH=$PATH:$FLUTTER_HOME/bin:$ANDROID_SDK_ROOT/cmdline-tools/latest/bin:$ANDROID_SDK_ROOT/platform-tools
RUN apt-get update && apt-get install -y \
curl git-all unzip xz-utils zip libglu1-mesa openjdk-11-jdk wget \
bash adb android-sdk libjaxb-api-java libjaxb-java libxmlunit-java
RUN mkdir -p $ANDROID_SDK_ROOT && cd $ANDROID_SDK_ROOT && \
wget https://dl.google.com/android/repository/commandlinetools-linux-8092744_latest.zip && \
unzip commandlinetools-linux-8092744_latest.zip && rm commandlinetools-linux-8092744_latest.zip && \
mkdir -p cmdline-tools/latest && \
mv cmdline-tools/bin cmdline-tools/latest/ && \
mv cmdline-tools/lib cmdline-tools/latest/ && \
ls -R $ANDROID_SDK_ROOT # Debug command
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
ENV PATH=$PATH:$JAVA_HOME/bin
RUN yes | sdkmanager --sdk_root=${ANDROID_SDK_ROOT} --licenses && \
sdkmanager --sdk_root=${ANDROID_SDK_ROOT} "platform-tools" "platforms;android-30" "build-tools;30.0.3" && \
rm -rf ${ANDROID_SDK_ROOT}/platform-tools-2
RUN git clone https://github.com/flutter/flutter.git $FLUTTER_HOME && \
cd $FLUTTER_HOME && \
git checkout $FLUTTER_VERSION && \
flutter precache && \
flutter config --no-analytics --android-sdk /opt/android-sdk && \
flutter doctor --android-licenses && \
flutter update-packages
WORKDIR /app
COPY . .
RUN curl -o assets/coins.json https://raw.githubusercontent.com/KomodoPlatform/coins/master/coins && \
curl -o assets/coins_config.json https://raw.githubusercontent.com/KomodoPlatform/coins/master/utils/coins_config.json
CMD ["/bin/bash"]
#!/bin/bash
repo=https://github.com/KomodoPlatform/komodo-wallet-mobile
tag="v$versionName"
builtApk=$workDir/splits/base-master.apk
read -p "Enter your device-spec.json's working directory: " deviceSpecPath
prepare() {
echo "Testing $appId from $repo revision $tag (revisionOverride: '$revisionOverride')..."
mkdir -p $workDir
cd $workDir
echo "Trying to clone …"
if [ -n "$revisionOverride" ]
then
git clone --quiet $repo . && git checkout "$revisionOverride" || exit 1
else
git clone --quiet --branch "$tag" --depth 1 $repo . || exit 1
fi
commit=$( git log -n 1 --pretty=oneline | sed 's/ .*//g' )
echo "Copying device-spec.json to the working directory..."
cp "$deviceSpecPath" "$workDir/device-spec.json"
}
test() {
curl -L https://raw.githubusercontent.com/KomodoPlatform/coins/master/coins --output assets/coins.json
curl -L https://raw.githubusercontent.com/KomodoPlatform/coins/master/utils/coins_config.json --output assets/coins_config.json
docker build -f $SCRIPT_DIR/test/android/com.komodoplatform.atomicdex.dockerfile -t komodo-image .
docker run \
--rm \
--volume $PWD:/app \
--name komodo-wallet \
komodo-image \
bash -c "
mkdir -p /app/android/app/src/main/cpp/libs/arm64-v8a && \
mkdir -p /app/android/app/src/main/cpp/libs/armeabi-v7a && \
cd /app/android/app/src/main/cpp/libs/arm64-v8a && \
wget https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-android-aarch64-CI.zip && \
unzip mm2-b0fd99e84-android-aarch64-CI.zip && \
rm mm2-b0fd99e84-android-aarch64-CI.zip && \
cd /app/android/app/src/main/cpp/libs/armeabi-v7a && \
wget https://github.com/KomodoPlatform/komodo-defi-framework/releases/download/v2.0.0-beta/mm2-b0fd99e84-android-armv7-CI.zip && \
unzip mm2-b0fd99e84-android-armv7-CI.zip && \
rm mm2-b0fd99e84-android-armv7-CI.zip && \
cd /app/ && \
flutter pub get && \
flutter build appbundle && \
wget https://github.com/google/bundletool/releases/download/1.17.1/bundletool-all-1.17.1.jar && \
java -jar bundletool-all-1.17.1.jar build-apks --bundle=build/app/outputs/bundle/release/app-release.aab --device-spec=device-spec.json --output=build/app/outputs/bundle/release/apk-files.apks && \
unzip -q build/app/outputs/bundle/release/apk-files.apks"
}
Once merged, you may run the following,
$./test.sh --apk /path/to/com.komodoplatform.atomicdex_v105.apk
Thank you!
Hi team,
I'm trying to reproduce version 0.9.0 and while the version is not tagged, Emanuel identified a likely commit in #60. But ... my attempts to build the product in a reproducible way are so far not successful. Could you please help me build without Android Studio in a container?!
Update 2024-02-09: This app is source-available but despite various comments on the open issue 60 there is no reaction from the provider.
Emanuel has identified this commit as likely candidate for the current version
v0.9.0
on Google Play. Let's see if we can compile it using the readme and what it points to ...and that's where we give up for now. The build instructions are geared towards IDE integration, explaining how to build the project with Android Studio while we need isolation in a docker container for example and automation via the command line.