Skip to content

F-Droid can't build #1274

Description

@licaon-kter
 --- ServerBox_v1.0.1480_amd64/smali/tech/lolli/toolbox/a.smali
 +++ tech.lolli.toolbox_148001/smali/tech/lolli/toolbox/a.smali
 @@ -396,15 +396,15 @@
      .line 24
      .line 25
      invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
  
      .line 26
      .line 27
      .line 28
 -    const-string v2, "2|148002|"
 +    const-string v2, "2|148001|"
  
      .line 29
      .line 30
      invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
  
      .line 31
      .line 32

ref: https://gitlab.com/fdroid/checkupdates-bot-fdroiddata/-/jobs/15801299955

Activity

  1. winnowl commented on Aug 13, 2026

    @winnowl

    Issue triage

    Feasibility:needs-clarification | Risk:medium

  2. coderabbitai commented on Aug 13, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #1139 - fix: fdroid build [merged]
    #1140 - fix: strip android native build ids for fdroid [merged]
    #1197 - Fix CI configuration and add error handling to make.dart [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    You can configure auto-planning by selecting labels in the issue_enrichment configuration.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. added
    bugSomething isn't working
    questionFurther information is requested
    on Aug 13, 2026
  4. GT-610 commented on Aug 14, 2026

    @GT-610
    Contributor

    GitHub release builds create all ABI splits in one Flutter invocation, while F-Droid builds each ABI separately. The per-output version code is therefore not stable in the shared classes.dex: the release x86_64 APK contained 148002, while F-Droid's standalone x86_64 build contained 148001.

    Should be fixed in #1278.

  5. licaon-kter commented on Aug 14, 2026

    @licaon-kter
    Author

    ping when a release is ready

  6. linsui commented on Sep 1, 2026

    @linsui

    This issue is not fixed. It seems you do build different abis one by one in https://github.com/lollipopkit/flutter_server_box/blob/main/scripts/release/build-fdroid.sh but the diff shows that your apks are built together. https://gitlab.com/fdroid/fdroiddata/-/jobs/16230273630 And there is a lib not reproducible.

  7. linsui commented on Sep 4, 2026

    @linsui

    Thanks!

  8. reopened this on Sep 4, 2026
  9. GT-610 commented on Sep 4, 2026

    @GT-610
    Contributor

    Seems that I accidentally close this issue. I'll leave it open until next release is built successfully

  10. lollipopkit commented on Sep 28, 2026

    @lollipopkit
    Owner

    @licaon-kter @linsui v1.0.1617 is ready. The failure in job 16230273630 was v1.0.1553, which predates #1394; since then each ABI is built separately in the release (the amd64 APK's NativeAssetsManifest.json contains only android_x64), and libsbm_ffi.so is path-remapped and checked by two independent builds before publication.

    The recipe changed: it now runs scripts/release/prepare-fdroid.sh / build-fdroid.sh. The template is in fdroid/README.md; for this release <build> = 1617, <commit> = f8e9656fe7e9154d214f7d457ea64bd362feea46. !45348 carries the old recipe at 1.0.1553 and can be closed.

  11. linsui commented on Sep 28, 2026

    @linsui

    It seems your script is designed for a offline build environment. https://github.com/lollipopkit/flutter_server_box/blob/main/scripts/release/prepare-fdroid.sh Does it build the apk twice?

  12. lollipopkit commented on Sep 28, 2026

    @lollipopkit
    Owner

    Yes, it builds twice. prepare-fdroid.sh runs one full release build only to seed the Gradle cache, then flutter clean, so that FDROID_OFFLINE=true build-fdroid.sh can rebuild with networking blocked.

    To build once, skip prepare-fdroid.sh and run scripts/release/build-fdroid.sh <abi> (without FDROID_OFFLINE) in build; it fetches Pub, Cargo and Gradle dependencies itself. sudo would also need rustup gcc libc-dev.

    Does fdroiddata need the build phase to be offline? If not, I'll change the template in fdroid/README.md to the single build.

  13. linsui commented on Sep 28, 2026

    @linsui

    No we don't need to be offline. But we need to scan the pub cache.

  14. lollipopkit commented on Sep 28, 2026

    @lollipopkit
    Owner

    Thanks. For v1.0.1617 the scripts already honour an external PUB_CACHE, so the recipe can fetch into the source tree in prebuild and build once:

        sudo:
          - apt-get update
          - apt-get install -y zip unzip make rustup gcc libc-dev
        prebuild:
          - flutterVersion=$(sed -n -E 's/^[[:space:]]*flutter-version:[[:space:]]*([^[:space:]]+).*/\1/p'
            .github/actions/setup-flutter/action.yml)
          - '[[ $flutterVersion ]]'
          - git -C $$flutter$$ checkout -f $flutterVersion
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - flutter config --no-analytics
          - flutter pub get --enforce-lockfile
        scandelete:
          - .pub-cache
          - packages/xterm/example/assets/specs_v1.json.gz
          - third_party/ish-arm64/benchmark/assets
        build:
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - scripts/release/build-fdroid.sh amd64

    (arm / arm64 likewise.) Compared with the recipe in !45348, the move to /home/runner/... and the build.gradle / jni sed edits are no longer needed: native paths are remapped, build-fdroid.sh sets allowUnsignedRelease and patches jni itself. It also prunes dev-only plugins, which the plain flutter build in !45348 doesn't, and is likely why AndroidManifest.xml differed.

  15. linsui commented on Sep 28, 2026

    @linsui

    scripts/build-proot-android.sh

    This should be put in the build script.

  16. lollipopkit commented on Sep 29, 2026

    @lollipopkit
    Owner

    Agreed. Complete metadata for v1.0.1617:

    tech.lolli.toolbox.yml: v1.0.1617
      - versionName: 1.0.1617
        versionCode: 161701
        commit: f8e9656fe7e9154d214f7d457ea64bd362feea46
        submodules: true
        sudo:
          - apt-get update
          - apt-get install -y zip unzip make rustup gcc libc-dev
        output: build/app/outputs/apk/release/app-x86_64-release-unsigned.apk
        binary:
          https://github.com/lollipopkit/flutter_server_box/releases/download/v%v/ServerBox_v%v_amd64.apk
        srclibs:
          - flutter@stable
        rm:
          - ios
          - linux
          - macos
          - test
          - windows
        prebuild:
          - flutterVersion=$(sed -n -E 's/^[[:space:]]*flutter-version:[[:space:]]*([^[:space:]]+).*/\1/p'
            .github/actions/setup-flutter/action.yml)
          - '[[ $flutterVersion ]]'
          - git -C $$flutter$$ checkout -f $flutterVersion
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - flutter config --no-analytics
          - flutter pub get --enforce-lockfile
        scandelete:
          - .pub-cache
          - packages/xterm/example/assets/specs_v1.json.gz
          - third_party/ish-arm64/benchmark/assets
        build:
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - scripts/release/build-fdroid.sh amd64
        target: android-36
        ndk: r28c
    
      - versionName: 1.0.1617
        versionCode: 161702
        commit: f8e9656fe7e9154d214f7d457ea64bd362feea46
        submodules: true
        sudo:
          - apt-get update
          - apt-get install -y zip unzip make rustup gcc libc-dev
        output: build/app/outputs/apk/release/app-armeabi-v7a-release-unsigned.apk
        binary:
          https://github.com/lollipopkit/flutter_server_box/releases/download/v%v/ServerBox_v%v_arm.apk
        srclibs:
          - flutter@stable
        rm:
          - ios
          - linux
          - macos
          - test
          - windows
        prebuild:
          - flutterVersion=$(sed -n -E 's/^[[:space:]]*flutter-version:[[:space:]]*([^[:space:]]+).*/\1/p'
            .github/actions/setup-flutter/action.yml)
          - '[[ $flutterVersion ]]'
          - git -C $$flutter$$ checkout -f $flutterVersion
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - flutter config --no-analytics
          - flutter pub get --enforce-lockfile
        scandelete:
          - .pub-cache
          - packages/xterm/example/assets/specs_v1.json.gz
          - third_party/ish-arm64/benchmark/assets
        build:
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - scripts/release/build-fdroid.sh arm
        target: android-36
        ndk: r28c
    
      - versionName: 1.0.1617
        versionCode: 161703
        commit: f8e9656fe7e9154d214f7d457ea64bd362feea46
        submodules: true
        sudo:
          - apt-get update
          - apt-get install -y zip unzip make rustup gcc libc-dev
        output: build/app/outputs/apk/release/app-arm64-v8a-release-unsigned.apk
        binary:
          https://github.com/lollipopkit/flutter_server_box/releases/download/v%v/ServerBox_v%v_arm64.apk
        srclibs:
          - flutter@stable
        rm:
          - ios
          - linux
          - macos
          - test
          - windows
        prebuild:
          - flutterVersion=$(sed -n -E 's/^[[:space:]]*flutter-version:[[:space:]]*([^[:space:]]+).*/\1/p'
            .github/actions/setup-flutter/action.yml)
          - '[[ $flutterVersion ]]'
          - git -C $$flutter$$ checkout -f $flutterVersion
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - flutter config --no-analytics
          - flutter pub get --enforce-lockfile
        scandelete:
          - .pub-cache
          - packages/xterm/example/assets/specs_v1.json.gz
          - third_party/ish-arm64/benchmark/assets
        build:
          - export PATH=$$flutter$$/bin:$PATH
          - export PUB_CACHE=$(pwd)/.pub-cache
          - scripts/release/build-fdroid.sh arm64
        target: android-36
        ndk: r28c
    
    CurrentVersion: 1.0.1617
    CurrentVersionCode: 161703
  17. linsui commented on Sep 29, 2026

    @linsui

    So the prepare script is not needed?

  18. lollipopkit commented on Sep 29, 2026

    @lollipopkit
    Owner

    Right, not for F-Droid. It's only used by our CI to check that the build fetches nothing when offline.

  19. linsui commented on Oct 8, 2026

    @linsui

    https://gitlab.com/fdroid/fdroiddata/-/jobs/17018231308 Could you please build the apks one by one? Or maybe the NativeAssetsManifest file can be excluded from the apk?

  20. lollipopkit commented on Oct 9, 2026

    @lollipopkit
    Owner

    Thanks for the log. We reproduced that job locally; there are two things in the recipe and one on our side.

    1. build runs scripts/release/build-fdroid.sh without an ABI, so it builds every ABI in one Flutter invocation. That is where NativeAssetsManifest.json (all three ABIs listed) and AndroidManifest.xml (source line numbers shifted by one) differ. Passing amd64 / arm / arm64, one per build entry, makes both match.
    2. libapp.so embeds the Flutter channel (a dependency reads FlutterVersion.channel). After git -C $$flutter$$ checkout -f $flutterVersion Flutter is on a detached HEAD, so the channel is [user-branch] rather than stable, and --dart-define cannot override it. Would git -C $$flutter$$ checkout -B stable $flutterVersion be acceptable in the recipe? And is the flutter srclib a fresh checkout for each build? Flutter caches the channel in bin/cache/flutter.version.json, so one left over from an earlier build would keep [user-branch].
    3. On our side, the release APKs were built with a different command from build-fdroid.sh, so libapp.so could not have matched anyway. fix(ci): build the release APKs with build-fdroid.sh, then sign them #1677 builds the release with that script and signs it afterwards; with that change and the two points above, our rebuild matched the CI-built APK in everything except the signature.

    So excluding NativeAssetsManifest.json won't be needed.

  21. linsui commented on Oct 9, 2026

    @linsui

    That's a known issue. You can disable that info if you want. I thought it's logged by a lib or something. I can also fix that on our side with git reset. :)

  22. lollipopkit commented on Oct 10, 2026

    @lollipopkit
    Owner

    Thanks! It comes from the sentry package (it reads FlutterVersion.channel for the runtime context), so we can't turn it off without patching sentry. A fix on your side would be great.

    Note the pinned version moved: FLUTTER_VERSION is no longer in build.yml, it is now flutter-version in .github/actions/setup-flutter/action.yml (CI uses it with channel: stable; build-fdroid.sh fails if the active Flutter differs). So something like:

    flutterVersion=$(sed -n -E 's/^\s+flutter-version:\s*(\S+)\s*$/\1/p' .github/actions/setup-flutter/action.yml)
    git -C $$flutter$$ checkout -B stable $flutterVersion
    

    The recipe should also pass the ABI to build-fdroid.sh (amd64 / arm / arm64). #1677 is merged, so the release APKs from the next version should match.

  23. linsui commented on Oct 10, 2026

    @linsui

    Thanks! Please ping me when there is a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions