Blockstream / green_android

Blockstream Green Wallet for Android
GNU General Public License v3.0
184 stars 74 forks source link

F-Droid fails to build #114

Closed jspricke closed 3 years ago

jspricke commented 3 years ago

Hi, your last release fails to build on F-Droid, can you have a look?

/home/vagrant/build/com.greenaddress.greenbits_android_wallet/crypto/build/intermediates/runtime_library_classes_jar/release/classes.jar: R8: Type com.blockstream.libwally.Wally$Obj is defined multiple times: /home/vagrant/build/com.greenaddress.greenbits_android_wallet/crypto/build/intermediates/runtime_library_classes_jar/release/classes.jar:com/blockstream/libwally/Wally$Obj.class, /home/vagrant/build/com.greenaddress.greenbits_android_wallet/app/build/intermediates/javac/productionRelease/classes/com/blockstream/libwally/Wally$Obj.class

https://monitor.f-droid.org/builds/log/com.greenaddress.greenbits_android_wallet/354

jspricke commented 3 years ago

The new version still fails to build: https://monitor.f-droid.org/builds/log/com.greenaddress.greenbits_android_wallet/355 Would be great if you could look into it.

jspricke commented 3 years ago

The latest version now fails with:

Task 'assembleProductionRelease' not found in project ':app'.

https://monitor.f-droid.org/builds/log/com.greenaddress.greenbits_android_wallet/357

lvaccaro commented 3 years ago

Hi @jspricke, sorry to be late.. I suggest to run ./gradlew assembleProductionRelease in the root of the project as travis https://github.com/Blockstream/green_android/blob/edec1720cb313888b2de77fe45b59fe49e544cf6/.travis.yml#L23

jspricke commented 3 years ago

It now fails with:

2021-04-22 12:06:44,285 ERROR: Could not build app com.greenaddress.greenbits_android_wallet: Failed to find any output apks

https://monitor.f-droid.org/builds/log/com.greenaddress.greenbits_android_wallet/357 What is the filename of the output apk?

emanuelb commented 3 years ago

@jspricke filename of output apk are either:

filename: app-production-release-unsigned.apk in location: ./app/build/outputs/apk/production/release/app-production-release-unsigned.apk (for older versions)

or filename green-production-release-unsigned.apk in location: ./green/build/outputs/apk/production/release/green-production-release-unsigned.apk (for latest version/commit)

are generated by ./gradlew assembleProductionRelease command.

jspricke commented 3 years ago

I looked into it a little more, tried building from root or green and also tried the latest release (3.5.9), but now I get 403 when downloading https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.gz.

emanuelb commented 3 years ago

yes, bintray closed their service on May 1: https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/ so it will return 403 error for links on https://dl.bintray.com/, the fix is to change the url to: https://boostorg.jfrog.io/artifactory/main/release/1.72.0/source/boost_1_72_0.tar.gz as was applied in commit: https://github.com/Blockstream/gdk/commit/fa82fb3138ffc7fd2c8515642a33b665b748ee92 but this commit applied after the currently latest release for gdk "release_0.0.41" (so will applied in next version/tag which is not released yet) so probably manual fix is needed such as by calling sed to change the url in subprojects/boost.wrap file.

emanuelb commented 3 years ago

There is new tag release_3.6.0 https://github.com/Blockstream/green_android/releases/tag/release_3.6.0 which use newer gdk version that fixed above bug, can you retry again on 3.6.0 version?

jspricke commented 3 years ago

I switched gradle to production but the build failed with: Task 'assembleProductionRelease' not found in project ':app'.

lvaccaro commented 3 years ago

Following https://github.com/Blockstream/green_android/blob/master/.gitlab-ci.yml#L21 Running gradle inside the root repo folder as ./gradlew assembleProductionRelease should generate the apk in path green/build/outputs/apk/production/release/*.apk

jspricke commented 3 years ago

I got it to build, thx! Only looks like that the version code is set to 22000360 instead of 360, is that expected? MR here: https://gitlab.com/fdroid/fdroiddata/-/merge_requests/9135

lvaccaro commented 3 years ago

you are welcome :-)

Unfortunately it looks like a technical debt from greenbits release (precursor of green) introduced at https://github.com/greenaddress/GreenBits/commit/a1a6ab92676826de1dcd0c79af09dfab04797bdc .

In the prebuild section of green metadata for fdroid, there is a version code override :

prebuild: sed -i -e 's/output.versionCodeOverride =/0 + /g' build.gradle

This command is ignored because the versionCode information is inside green/build.gradle instead of build.gradle. On the other hand, downgrading version code is not a good practice, following https://developer.android.com/studio/publish/versioning .

jspricke commented 3 years ago

I was wondering about that, no idea why it is there :D. Are you ok with removing the prebuild?

lvaccaro commented 3 years ago

maybe because it could look a bit odd the 22000360. If you remove the prebuild line, remember to align the versionCode field in the .yml.

jspricke commented 3 years ago

It was build successful, thanks for the help: https://monitor.f-droid.org/builds/log/com.greenaddress.greenbits_android_wallet/22000360