Closed licaon-kter closed 2 months ago
We are going to push to another public maven repo.
@roeierez any timeframe? I see that 4.0.10 was tagged
@licaon-kter we are working on integrating with https://jitpack.io/ we hope to resolve these and publish in a week or so (cc @cnixbtc) Can you confirm this is going to work with F-Droid?
Also the the breez sdk dependency is an open source project, you can find the build instructions for the android package here: https://github.com/breez/breez-sdk/tree/main/libs/sdk-bindings
* What went wrong: Execution failed for task ':lightning:compileReleaseJavaWithJavac'. > Could not resolve all files for configuration ':lightning:releaseCompileClasspath'. > Could not find breez_sdk:bindings-android:0.1.0. Required by: project :lightning
How can we reproduce?
No other maven except their own? https://sdk-doc.breez.technology/
Is this a problem for fdroid building?
Can we build this from source?
Yes. See https://github.com/breez/breez-sdk/tree/main/libs/sdk-bindings
How can we reproduce?
Remove breez.technology maven repo from code
Is this a problem for fdroid building?
Yes, see https://f-droid.org/2022/07/22/maven-central.html and https://f-droid.org/en/docs/Inclusion_Policy/ from "Trusted maven repos"
Ok, so... this srclib/breez-sdk.yml
was added:
RepoType: git
Repo: https://github.com/breez/breez-sdk.git
Subdir: libs/sdk-bindings
and the recipe adapted:
- versionName: 4.0.11
versionCode: 22000411
commit: 27bdf31e92b3d07acb2c912e6bcc141147b6eccf
timeout: 25200
subdir: green
sudo:
- apt-get update
- apt-get install -y automake clang cmake jq libffi-dev libtool make pkg-config
swig virtualenv protobuf-compiler
- apt-get install -y openjdk-17-jdk-headless
- update-java-alternatives -a
gradle:
- production
srclibs:
- breez-sdk@0.1.4
- rustup@1.25.2
rm:
- bump_gdk.sh
prebuild:
- sed -i -e '/mvn.breez/d' ../build.gradle.kts
- sed -i -e '/signingConfigs {/,+8d' -e '/signingConfigs.getByName/,+3d' -e
'/versionNameSuffix/d' build.gradle.kts
- sed -i -e '/dependencies {/aimplementation(files(\"libs/breez-sdk.aar\"))'
build.gradle.kts
build:
- $$rustup$$/rustup-init.sh -y
- source $HOME/.cargo/env
- rustup install 1.68.0
- export ANDROID_NDK_HOME=$$NDK$$
- pushd $$breez-sdk$$
- sed -i -e '/apple/d' makefile
- make init
- make bindings-android
- popd
- mkdir -p libs
- cp $$breez-sdk$$/bindings-android/lib/build/outputs/aar/lib-release.aar libs/breez-sdk.aar
- JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") PATH=$HOME/.local/bin:$PATH
../gdk/prepare_gdk_clang.sh arm64-v8a
ndk: r25c
But fails:
...
> Task :lightning:compileReleaseJavaWithJavac FAILED
> Task :gdk:mergeReleaseJniLibFolders
> Task :no-gms:javaPreCompileRelease
> Task :green:dataBindingMergeDependencyArtifactsProductionRelease FAILED
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':lightning:compileReleaseJavaWithJavac'.
> Could not resolve all files for configuration ':lightning:releaseCompileClasspath'.
> Could not find breez_sdk:bindings-android:0.1.4.
Required by:
project :lightning
full log: com.greenaddress.greenbits_android_wallet_22000411.log.gz
Surely this is an easy fix, right? Maybe I've not setup the kotlin thing to pickup the .aar correctly? Maybe easier?
How can we reproduce?
Remove breez.technology maven repo from code
I want to run fdroid build
in a vagrant vm to reproduce the problem but I cannot find the config.yml that you used to build.
Save this as metadata/com.greenaddress.greenbits_android_wallet.yml
: https://gist.github.com/licaon-kter/c86fd8a8de5b5536b5fea968f4d2f15b
Don't forget to create srclib/breez-sdk.yml
:
RepoType: git
Repo: https://github.com/breez/breez-sdk.git
Subdir: libs/sdk-bindings
run as: fdroid build --verbose --scan-binary --server com.greenaddress.greenbits_android_wallet
@licaon-kter is breez maven repo still an issue?
@angelix yes, no progress here
Please check a260b4a46631da205784131c5671917fa35f065c for a temp solution.
In common/build.gradle.kts
you have to make the following changes(comment/uncomment)
comment breez kmp dependency
/** --- Breez ------------------------------------------------------------------------------ */
// api(libs.breez.sdk.kmp)
/** ----------------------------------------------------------------------------------------- */
uncomment breez android dependency
// Temp fix for FDroid breez dependencies
api(libs.breez.sdk.android)
If it works i can add the change to prepare_fdroid.sh
if it's used
@licaon-kter if you have any other ideas on how to solve this issue, please let me know.
So updated recipe, afaik
- versionName: 4.0.18
versionCode: 22000418
commit: 57dc1781c143d79dac5dc0b68fc5ec1d25aadbb1
timeout: 25200
subdir: green
sudo:
- apt-get update
- apt-get install -y automake clang cmake jq libffi-dev libtool make pkg-config
swig virtualenv xz-utils
- apt-get install -y openjdk-17-jdk-headless
- update-java-alternatives -a
gradle:
- production
srclibs:
- rustup@1.25.2
prebuild:
- sed -i -e '/mvn.breez/d' -e '/zendesk/d' ../build.gradle.kts
- sed -i -e '/libs.breez.sdk.kmp/d' -e 's!// api(libs.breez.sdk.android)!api(libs.breez.sdk.android)!' ../common/build.gradle.kts
- sed -i -e '/signingConfigs {/,+8d' -e '/signingConfigs.getByName/,+3d' -e
'/versionNameSuffix/d' build.gradle.kts
build:
- $$rustup$$/rustup-init.sh -y
- source $HOME/.cargo/env
- rustup install 1.68.0
- rustup target add aarch64-linux-android armv7-linux-androideabi
- JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") PATH=$HOME/.local/bin:$PATH
../gdk/prepare_gdk_clang.sh arm64-v8a
- JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") PATH=$HOME/.local/bin:$PATH
../gdk/prepare_gdk_clang.sh armeabi-v7a
ndk: r25c
but fails somewhere: com.greenaddress.greenbits_android_wallet_22000418.log.gz
Ideas?
So updated recipe, afaik
- versionName: 4.0.18 versionCode: 22000418 commit: 57dc1781c143d79dac5dc0b68fc5ec1d25aadbb1 timeout: 25200 subdir: green sudo: - apt-get update - apt-get install -y automake clang cmake jq libffi-dev libtool make pkg-config swig virtualenv xz-utils - apt-get install -y openjdk-17-jdk-headless - update-java-alternatives -a gradle: - production srclibs: - rustup@1.25.2 prebuild: - sed -i -e '/mvn.breez/d' -e '/zendesk/d' ../build.gradle.kts - sed -i -e '/libs.breez.sdk.kmp/d' -e 's!// api(libs.breez.sdk.android)!api(libs.breez.sdk.android)!' ../common/build.gradle.kts - sed -i -e '/signingConfigs {/,+8d' -e '/signingConfigs.getByName/,+3d' -e '/versionNameSuffix/d' build.gradle.kts build: - $$rustup$$/rustup-init.sh -y - source $HOME/.cargo/env - rustup install 1.68.0 - rustup target add aarch64-linux-android armv7-linux-androideabi - JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") PATH=$HOME/.local/bin:$PATH ../gdk/prepare_gdk_clang.sh arm64-v8a - JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") PATH=$HOME/.local/bin:$PATH ../gdk/prepare_gdk_clang.sh armeabi-v7a ndk: r25c
but fails somewhere: com.greenaddress.greenbits_android_wallet_22000418.log.gz
Ideas?
Seems for some reason gradle tries to download gdk binaries.
Can you comment out the following line in /gdk/build.gradle.kts
?
commandLine("./fetch_android_binaries.sh")
If I comment/remove that line if fails with
Execution failed for task ':gdk:fetchAndroidBinaries'.
> execCommand == null!
If I remove https://github.com/Blockstream/green_android/blob/release_4.0.18/gdk/build.gradle.kts#L25-L43 it fails later for some other reason :(
@licaon-kter Can you try with 47c14fd9d69c9c54b9a37d20846b43808315b94c?
> Task :green:mergeProductionReleaseJavaResource
> Task :green:minifyProductionReleaseWithR8 FAILED
ERROR: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar: R8: Type com.blockstream.libgreenaddress.GDKJNI$NotificationHandler is defined multiple times: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar:com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class, /home/vagrant/build/com.greenaddress.greenbits_android_wallet/green/build/intermediates/javac/productionRelease/classes/com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class
> Task :green:lintVitalAnalyzeProductionRelease
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':green:minifyProductionReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
> Compilation failed to complete, origin: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar:com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class
full log: @angelix
com.greenaddress.greenbits_android_wallet_22000418.log.gz
> Task :green:mergeProductionReleaseJavaResource > Task :green:minifyProductionReleaseWithR8 FAILED ERROR: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar: R8: Type com.blockstream.libgreenaddress.GDKJNI$NotificationHandler is defined multiple times: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar:com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class, /home/vagrant/build/com.greenaddress.greenbits_android_wallet/green/build/intermediates/javac/productionRelease/classes/com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class > Task :green:lintVitalAnalyzeProductionRelease FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':green:minifyProductionReleaseWithR8'. > A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable > Compilation failed to complete, origin: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar:com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class
full log: @angelix com.greenaddress.greenbits_android_wallet_22000418.log.gz
Great, those logs gave me full understanding on what's going on.
Seems that you both build and download gdk binaries.
If you still want to build gdk binaries from source, i'll get you a solution in a bit.
Also
> Configure project :common
Please wait while Kotlin/Native compiler 1.9.20 is being installed.
Download https://download.jetbrains.com/kotlin/native/builds/releases/1.9.20/linux-x86_64/kotlin-native-prebuilt-linux-x86_64-1.9.20.tar.gz (198.16 MB)
Download kotlin-native-prebuilt-linux-x86_64-1.9.20.tar.gz finished, took 18 s 452 ms
Unpack Kotlin/Native compiler to /home/vagrant/.konan/kotlin-native-prebuilt-linux-x86_64-1.9.20
Unpack Kotlin/Native compiler to /home/vagrant/.konan/kotlin-native-prebuilt-linux-x86_64-1.9.20 finished, took 16 s 138 ms
...is a big no-no, ref: https://gitlab.com/fdroid/fdroiddata/-/issues/2989
Alternatively, you could try downloading the K/N distribution from maven central: https://central.sonatype.com/artifact/org.jetbrains.kotlin/kotlin-native-prebuilt
Would this be possible?
Alternatively, you could try downloading the K/N distribution from maven central: https://central.sonatype.com/artifact/org.jetbrains.kotlin/kotlin-native-prebuilt
Would this be possible?
Using kotlin.native.distribution.downloadFromMaven=true
i got the following. So i guess we are ok on that.
Please wait while Kotlin/Native compiler 1.9.20 is being installed.
Downloading https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-native-prebuilt/1.9.20/kotlin-native-prebuilt-1.9.20-macos-aarch64.tar.gz to /Users/angelos/.gradle/.tmp/gradle_download11606821103669116292bin
<==-----------> 20% CONFIGURING [15s]
> Task :green:mergeProductionReleaseJavaResource > Task :green:minifyProductionReleaseWithR8 FAILED ERROR: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar: R8: Type com.blockstream.libgreenaddress.GDKJNI$NotificationHandler is defined multiple times: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar:com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class, /home/vagrant/build/com.greenaddress.greenbits_android_wallet/green/build/intermediates/javac/productionRelease/classes/com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class > Task :green:lintVitalAnalyzeProductionRelease FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':green:minifyProductionReleaseWithR8'. > A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable > Compilation failed to complete, origin: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/gdk/build/intermediates/runtime_library_classes_jar/release/classes.jar:com/blockstream/libgreenaddress/GDKJNI$NotificationHandler.class
I think the issue is in the build recipe file.
prepare_gdk_clang.sh
should be executed inside gdk
folder.
Please try with this:
build:
- $$rustup$$/rustup-init.sh -y
- source $HOME/.cargo/env
- rustup install 1.68.0
- rustup target add aarch64-linux-android armv7-linux-androideabi
- cd ../gdk
- JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") PATH=$HOME/.local/bin:$PATH
./prepare_gdk_clang.sh arm64-v8a
- JAVA_HOME=$(readlink -f /usr/bin/javac | sed "s:/bin/javac::") PATH=$HOME/.local/bin:$PATH
./prepare_gdk_clang.sh armeabi-v7a
@licaon-kter
With kotlin.native.distribution.downloadFromMaven=true
if you want to test.
https://github.com/Blockstream/green_android/tree/ave-fdroid
@licaon-kter Thank you for efforts and time.
Another issue: https://gitlab.com/fdroid/fdroiddata/-/jobs/6123519265#L785 as https://github.com/Blockstream/green_android/blob/release_4.0.24/compose/build.gradle.kts#L76 is not-FOSS
/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/cd48f23c912f66b6298b57dd3e1108a925cb94d2
Will be removed on next version.
Ping us when ready
@licaon-kter I added some metadata in #197. Can you confirm if the structure is ok? Thanks
@licaon-kter please check latest release
I added some metadata in https://github.com/Blockstream/green_android/pull/197. Can you confirm if the structure is ok?
looks ok
please check latest release
will do asap
Ummm
Please wait while Kotlin/Native compiler 1.9.22 is being installed.
Download kotlin-native-prebuilt-linux-x86_64-1.9.22.tar.gz finished, took 5 s 189 ms
better switch to Maven pls: https://central.sonatype.com/artifact/org.jetbrains.kotlin/kotlin-native-prebuilt ?
I've added libc6-dev but still complains about pthreads, what am I missing? com.greenaddress.greenbits_android_wallet_22000426.log.gz
Download kotlin-native-prebuilt-linux-x86_64-1.9.22.tar.gz finished, took 5 s 189 ms
Already using kotlin.native.distribution.downloadFromMaven=true
in gradle.properties
aaaand? :smile_cat:
aaaand? 😸
Still investigating the pthreads
issue. We use bullseye (deps script for docker), maybe bookworm needs also another package.
I've just started the build on my bullseye VM, brb
Indeed, builds fine on Bullseye, still downloads kotlin binaries
Indeed, builds fine on Bullseye, still downloads kotlin binaries
Kotlin multiplatform binaries will always be downloaded as are not pre-packageed with Kotlin, but instead of being downloaded from jetbrains.com, are downloaded from public maven repository.
Also please be sure to use productionFDroid
instead of production
. In the future i want to enable certain features for production flavor, still safe to use it btw.
Lastly, NonFreeNet antifeature flags can be removed as the issues mentioned in https://github.com/Blockstream/green_android/issues/164 are fixed.
Kotlin multiplatform binaries will always be downloaded as are not pre-packageed with Kotlin, but instead of being downloaded from jetbrains.com, are downloaded from public maven repository.
Ok, but... make it stop "Downloading from jetbrains"
From your logs
Please wait while Kotlin/Native compiler 1.9.22 is being installed.
Download kotlin-native-prebuilt-linux-x86_64-1.9.22.tar.gz finished, took 5 s 189 ms
Unpack Kotlin/Native compiler to /home/vagrant/.konan/kotlin-native-prebuilt-linux-x86_64-1.9.22
Unpack Kotlin/Native compiler to /home/vagrant/.konan/kotlin-native-prebuilt-linux-x86_64-1.9.22 finished, took 4 s 788 ms
From my machine with --info
Please wait while Kotlin/Native compiler 1.9.22 is being installed.
Downloading https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-native-prebuilt/1.9.22/kotlin-native-prebuilt-1.9.22-macos-aarch64.tar.gz to /Users/angelos/.gradle/.tmp/gradle_download1055476643572659025bin
Does it says jetbrains.com
anywhere?
I think the kotlin.native.distribution.downloadFromMaven=true
in gradle.properties
solved that.
Indeed, it might not, I don't have an actual URL in the logs.
Let me try something else, brb.
Any news on Bookworm?
Any news on Bookworm?
I have some issues trying to make it run in my M2 processor.
Did you try installing libevent-dev
?
I'm not sure which dep is needed (what hinted you about that one?), but I'll test asap
I'm not sure which dep is needed (what hinted you about that one?), but I'll test asap
A message from gdk dev:
libevent has some reported issues with android build, it has been fixed, but fixes have not been released in a new version yet. Though, I wonder why on our CI works and in theirs doesn't
Who is "our" and who is "their"? :)
Though, I wonder why on our (Blockstream's) CI works and in theirs (F-Droid) doesn't.
So Blockstream (whatever that is?!) already builds in a Docker/VM with Bookworm?
Can you link to their setup?
I'll gather more info about that.
No other maven except their own? https://sdk-doc.breez.technology/
Can we build this from source?
/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/554ea14f0cbc450dc5de881cb7ca077e3ac90f2d