Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Android - F-Droid can't build #430

Closed
licaon-kter opened this issue Mar 8, 2023 · 44 comments
Closed

[Bug] Android - F-Droid can't build #430

licaon-kter opened this issue Mar 8, 2023 · 44 comments
Assignees
Labels
Android Android related issue bug Something isn't working

Comments

@licaon-kter
Copy link

licaon-kter commented Mar 8, 2023

Saw version 17 fail: https://gitlab.com/fdroid/fdroiddata/-/jobs/3891617399

So I tried to bump Flutter to 3.7.6, but that brought up librust.so binary deps to the surface: https://gitlab.com/fdroid/fdroiddata/-/commit/493af32591b1b93607b30f9557a2e0c6b3a755b5#note_1305278538

OK, so I built that too: https://gitlab.com/fdroid/fdroiddata/-/commit/1e3e91193e2a6c7003a351fe1499a84bd6a37d0f

But still fails later in Flutter:
oss.krtirtho.spotube_17.log.gz

@licaon-kter licaon-kter added the bug Something isn't working label Mar 8, 2023
@RaptaG RaptaG added the Android Android related issue label Mar 8, 2023
@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

librust.so is a required dependency. It parses and writes metadata for mp3/m4a/ogg/floc etc audio formats
Removing it from the build will definitely cause error

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

Also not sure about rebuilding librust in the pipeline. Is it a good idea?

@licaon-kter
Copy link
Author

licaon-kter commented Mar 8, 2023

As said, we rebuild it... Also the error above is at build time, not while running the app... we did not reach that step yet. :)

What's next? Which Flutter version did you use?

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

Also the error above is at build time, not while running the app... we did not reach that step yet. :)

yeah right

What's next? Which Flutter version did you use?

v3.7.3

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

Also, the pipeline using Java 8 right?

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

Oh... Ok. In 2.7.0 I added a .env file which is required

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

@licaon-kter is there any way to provide the content of the .env file without exposing them?

Because, exposing those secrets can exploit user security plus can give bad actors access to the backend (https://spotube.pockethost.io/)

Root of the issue output:

[        ] Successfully started process 'command '/home/vagrant/build/srclib/flutter/bin/flutter''
[+86100 ms] Error detected in pubspec.yaml:
[        ] No file or variants found for asset: .env.            <--- this is causing the build error
[+34297 ms] Target aot_android_asset_bundle failed: Exception: Failed to bundle asset files.
[+4799 ms] > Task :app:compileFlutterBuildRelease FAILED
[  +99 ms] Android Lint: Disposing Uast application environment in lint classloader [30.2.1]
[ +100 ms] FAILURE: Build failed with an exception.
[        ] * Where:
[        ] Script '/home/vagrant/build/srclib/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 1151

@licaon-kter
Copy link
Author

is there any way to provide the content of the .env file without exposing them?

No... we have no secrets... your recipe already provides some: https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/oss.krtirtho.spotube.yml#L212-L213 are those not enough?

Btw, this workflow might help you https://github.com/KRTirtho/metadata_god/blob/v0.3.2/.github/workflows/build-libs.yaml
the pipeline using Java 8 right?

Yeah, saw it, but I kinda ignored Java 8 :)
Since last year we switched to Debian Bullseye so it's Java11 by default.
But I can have it use Java8 if needed.

Well... once you clarify what .env should contain.

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 8, 2023

Luckily, the app can run without the backend. So the basic info will get the job done. Let's do this workaround for this release, in the next one I'll use a better way of connecting to backend

So create the .env in project root before flutter build

$ echo "POCKETBASE_URL=https://spotube.pockethost.io/" >> .env

@licaon-kter
Copy link
Author

Taking it for a spin now

@licaon-kter
Copy link
Author

licaon-kter commented Mar 9, 2023

Can you test the APK? (remove .zip and unpack .001 with 7zip)
st.7z.001.zip
st.7z.002.zip
st.7z.003.zip
st.7z.004.zip

Another thing, it does not make sense to check for updates for the F-Droid build, so, is it enough to set this to false at build time? https://github.com/KRTirtho/spotube/blob/v2.7.0/lib/provider/user_preferences_provider.dart#L51

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

Yeah, an Env variable to toggle this on and off must be added

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

Cannot open archive. 7z not working

$  7zz e st.7z.001
7-Zip (z) 22.01 (x64) : Copyright (c) 1999-2022 Igor Pavlov : 2022-07-15
 64-bit locale=en_US.UTF-8 Threads:4, ASM

Scanning the drive for archives:
1 file, 9437184 bytes (9216 KiB)

Extracting archive: st.7z.001
ERROR: st.7z.001
st.7z
Open ERROR: Cannot open the file as [7z] archive


ERRORS:
Unexpected end of archive
    
Can't open as archive: 1
Files: 0
Size:       0

@licaon-kter
Copy link
Author

The archive files work fine for me, delete them and redownload 🤷

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

Can you provide me this with a zip format. I don't know why these are not working. Other 7z files working fine

@licaon-kter
Copy link
Author

licaon-kter commented Mar 9, 2023

ZIP can't do multivolumes and the upload size is limited here 🤷

Did you save and renamed all 4 files before trying to unpack?

/LE:

is it enough to set this to false at build time? https://github.com/KRTirtho/spotube/blob/v2.7.0/lib/provider/user_preferences_provider.dart#L51

And the answer is ... no... as that makes it ... fail to build 😱

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

And the answer is ... no... as that makes it ... fail to build scream

No it should build, this means by default the update checker will be toggled off

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

Oh it was fragmented 7zip. I thought those are separate arch apk (aarch64, arm32, x86, x64) 😅
Was able to extract it

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

And I can confirm everything is still working as expected in the app

@licaon-kter
Copy link
Author

I've retried now and it build fine 🤦 nvm me then

Anyway, that line works fine, check update is disabled and the app does not start to connect to Github right away.

So, can we update the recipe to include this?

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

Yup

@licaon-kter
Copy link
Author

Done, thanks https://gitlab.com/fdroid/fdroiddata/-/commit/b0fec80aa3bd4e0e38d1b5e742d3a7b05f4d194a

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

No, thank you. You're helping so much in the open source community. Keep up your great service 👍

@licaon-kter
Copy link
Author

Regarding flutter, any chance you could add it as a submodule in your repo?

It will erase the need to manually open MRs when updating Flutter version, as you control the version directly here

ref: https://git-scm.com/book/en/v2/Git-Tools-Submodules

and ref: https://gitlab.com/fdroid/fdroiddata/-/blob/master/templates/build-flutter.yml

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

Just using .gitmodules?

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

But I already have a fvm configuration in the .fvm which is a natural way of handling flutter versions
Can f-droid use fvm automatically when it detects the .fvm/flutterSdkVersion file?

@licaon-kter
Copy link
Author

This is news to me, is this a new thing or? I don't recall Flutter devs using this so far... we're mostly guessing the version and "hope latest works" :)

@KRTirtho
Copy link
Owner

KRTirtho commented Mar 9, 2023

fvm has been around for a while now😄

@licaon-kter
Copy link
Author

I guess that most projects that are in F-Droid might not use it then

@KRTirtho
Copy link
Owner

You can always make it a requirement for flutter apps. It's better to keep track of Flutter versions for your app then failing on CI

@KRTirtho
Copy link
Owner

@licaon-kter Spotube 2.7.0 is still not available in the fdroid repo. Was there any problem building it?

@licaon-kter
Copy link
Author

licaon-kter commented Mar 23, 2023

@licaon-kter licaon-kter reopened this Apr 11, 2023
@licaon-kter
Copy link
Author

licaon-kter commented Apr 11, 2023

and again

ref: https://monitor.f-droid.org/builds/log/oss.krtirtho.spotube/18#site-footer

ref: KRTirtho/metadata_god#9

@KRTirtho
Copy link
Owner

I'll make an MR with the fix

@licaon-kter
Copy link
Author

It was more than this: https://gitlab.com/fdroid/fdroiddata/-/commit/c7e38b623e8dad0b1a521b716bfeaf4e4d70bd6e ? :)

Builds fine

@KRTirtho
Copy link
Owner

Man I fixed it already but forgot to create an MR 😂 All 3 hours in vain 🥲
Great work btw! Sorry for all the trouble ❤️

@licaon-kter
Copy link
Author

licaon-kter commented Jul 4, 2023

Recipe needs an update

So fails with: https://gitlab.com/fdroid/fdroiddata/-/jobs/4580191732#L779

Looks like maybe you forgot to bump flutter version? https://github.com/KRTirtho/spotube/blob/v3.0.0/.fvm/fvm_config.json#L2

Let me set it to 3.10.5 (latest stable) locally

Error when reading 'bin/create-secrets.dart': No such file or directory.

Oh... https://github.com/KRTirtho/spotube/tree/v3.0.0/bin

What now?

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/27476875c11e7f423a2cf239d03323dffdaf9100

@licaon-kter licaon-kter reopened this Jul 4, 2023
@KRTirtho
Copy link
Owner

KRTirtho commented Jul 4, 2023

Oops sorry. I always forget to update F-Droid scripts

@KRTirtho
Copy link
Owner

KRTirtho commented Jul 4, 2023

I'll update it and create a MR

@KRTirtho
Copy link
Owner

Closing as it is resolved now

It can be re-opened if same issue is face again

@linsui
Copy link

linsui commented Oct 17, 2023

We need the lastFmApiKey for 3.2.0. Could you please update the metadata? Thanks!

@KRTirtho
Copy link
Owner

Yea sure sure. Why do I always forget about F-Droid! 🤦

@KRTirtho
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Android Android related issue bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants