MY app doesn't build

So I have prepared my Flutter app for a reproducable F-Droid release:

Building works fine on my computer and on Github CI/CD action/workflow.

This is my F-Droid build file:
https://gitlab.com/Drexel2k/fdroiddata/-/blob/master/metadata/com.drexeldevelopment.openeatsjournal

I set up a local F-Droid server on an Ubuntu VM to test the build. This is my build command:

fdroid build --server -v com.drexeldevelopment.openeatsjournal

But this is the result:

==== detail begin ====
/etc/bash.bashrc: line 7: PS1: unbound variable

  • export repo=/home/runner/work/OpenEatsJournal/OpenEatsJournal
  • repo=/home/runner/work/OpenEatsJournal/OpenEatsJournal
  • cd ..
  • mv com.drexeldevelopment.openeatsjournal /home/runner/work/OpenEatsJournal/OpenEatsJournal
  • pushd /home/runner/work/OpenEatsJournal/OpenEatsJournal/src
    /home/runner/work/OpenEatsJournal/OpenEatsJournal/src ~/build
    ++ pwd
  • export PUB_CACHE=/home/runner/work/OpenEatsJournal/OpenEatsJournal/src/.pub-cache
  • PUB_CACHE=/home/runner/work/OpenEatsJournal/OpenEatsJournal/src/.pub-cache
  • /home/vagrant/build/srclib/flutter/bin/flutter build apk --release --split-per-abi --target-platform=android-x64 --split-debug-info=build/symbols
    [1/1] Android SDK
    ├─ [1/6] android-arm-profile/linux-x64 173ms
    ├─ [2/6] android-arm-release/linux-x64 64ms
    ├─ [3/6] android-arm64-profile/linux-x64 74ms
    ├─ [4/6] android-arm64-release/linux-x64 65ms
    ├─ [5/6] android-x64-profile/linux-x64 74ms
    └─ [6/6] android-x64-release/linux-x64 62ms
    Resolving dependencies…
    Downloading packages…
    _fe_analyzer_shared 103.0.0 (105.0.0 available)
    analyzer 13.3.0 (14.1.0 available)
    android_file_picker 1.0.1 (1.0.2 available)
    code_assets 1.2.1 (2.0.0 available)
    cross_file 0.3.5+4 (0.3.5+5 available)
    file_picker 12.0.0 (12.1.0 available)
    file_picker_darwin 1.0.1 (1.0.2 available)
    file_picker_platform_interface 3.0.1 (3.1.0 available)
    file_picker_web 3.0.1 (3.0.2 available)
    hooks 2.0.2 (2.2.0 available)
    material_color_utilities 0.13.0 (0.13.1 available)
    meta 1.18.3 (1.19.0 available)
    native_toolchain_c 0.19.2 (0.19.4 available)
    objective_c 9.5.0 (9.6.0 available)
    package_config 2.2.0 (3.0.0 available)
    record_use 0.6.0 (1.1.1 available)
    source_gen 4.2.4 (4.3.0 available)
    test 1.31.1 (1.31.2 available)
    test_api 0.7.12 (0.7.13 available)
    test_core 0.6.18 (0.6.19 available)
    vector_math 2.4.0 (2.4.2 available)
    windows_file_picker 1.0.1 (1.0.2 available)
    Got dependencies!
    22 packages have newer versions incompatible with dependency constraints.
    Try flutter pub outdated for more information.
    Running Gradle task ‘assembleRelease’…
    Warning: Flutter support for your project’s Gradle version (8.14.0) will soon be dropped. Please upgrade your Gradle version to a version of at least 9.1.0 soon.
    Alternatively, use the flag “–android-skip-build-dependency-validation” to bypass this check.

Potential fix: Your project’s gradle version is typically defined in the gradle wrapper file. By default, this can be found at /home/runner/work/OpenEatsJournal/OpenEatsJournal/src/android/gradle/wrapper/gradle-wrapper.properties.
For more information, see Gradle Wrapper.

Warning: Flutter support for your project’s Android Gradle Plugin version (Android Gradle Plugin version 8.11.1) will soon be dropped. Please upgrade your Android Gradle Plugin version to a version of at least Android Gradle Plugin version 9.0.1 soon.
Alternatively, use the flag “–android-skip-build-dependency-validation” to bypass this check.

Potential fix: Your project’s AGP version is typically defined in the plugins block of the settings.gradle file (/home/runner/work/OpenEatsJournal/OpenEatsJournal/src/android/settings.gradle), by a plugin with the id of com.android.application.
If you don’t see a plugins block, your project was likely created with an older template version. In this case it is most likely defined in the top-level build.gradle file (/home/runner/work/OpenEatsJournal/OpenEatsJournal/src/android/build.gradle) by the following line in the dependencies block of the buildscript: “classpath ‘com.android.tools.build:gradle:’”.

Warning: Flutter support for your project’s Kotlin version (2.2.20) will soon be dropped. Please upgrade your Kotlin version to a version of at least 2.3.20 soon.
Alternatively, use the flag “–android-skip-build-dependency-validation” to bypass this check.

Potential fix: Your project’s KGP version is typically defined in the plugins block of the settings.gradle file (/home/runner/work/OpenEatsJournal/OpenEatsJournal/src/android/settings.gradle), by a plugin with the id of org.jetbrains.kotlin.android.
If you don’t see a plugins block, your project was likely created with an older template version, in which case it is most likely defined in the top-level build.gradle file (/home/runner/work/OpenEatsJournal/OpenEatsJournal/src/android/build.gradle) by the ext.kotlin_version property.

Checking the license for package NDK (Side by side) 28.2.13676358 in /opt/android-sdk/licenses
License for package NDK (Side by side) 28.2.13676358 accepted.
Preparing “Install NDK (Side by side) 28.2.13676358 v.28.2.13676358”.
“Install NDK (Side by side) 28.2.13676358 v.28.2.13676358” ready.
Installing NDK (Side by side) 28.2.13676358 in /opt/android-sdk/ndk/28.2.13676358
“Install NDK (Side by side) 28.2.13676358 v.28.2.13676358” complete.
“Install NDK (Side by side) 28.2.13676358 v.28.2.13676358” finished.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring project ‘:mobile_scanner’.

java.lang.NullPointerException (no error message)

  • 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 1m 54s
Running Gradle task ‘assembleRelease’… 115.3s

┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────┐
│ [!] Starting AGP 9+, only the new DSL interface will be read. │
│ This results in a build failure when applying the Flutter Gradle plugin at │
│ /home/runner/work/OpenEatsJournal/OpenEatsJournal/src/android/app/build.gradle.kts. │
│ │
│ To resolve this update flutter or opt out of android.newDsl. │
│ For instructions on how to opt out, see: │
https://developer.android.com/build/releases/agp-9-0-0-release-notes
│ │
│ If you are not upgrading to AGP 9+, run flutter analyze --suggestions to check for │
│ incompatible dependencies. │
└──────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleRelease failed with exit code 1
==== detail end ====
2026-08-25 15:42:21,466 DEBUG: Error encountered, stopping by user request.
==== detail end ====
2026-08-25 17:42:23,794 DEBUG: skip deploying full build logs: not enabled in config
2026-08-25 17:42:23,812 DEBUG: skip deploying full build logs: not enabled in config
2026-08-25 17:42:23,813 INFO: Finished
2026-08-25 17:42:23,813 INFO: 3 builds failed
2026-08-25 17:42:23,831 DEBUG: skip deploying full build logs: not enabled in config
2026-08-25 17:42:23,848 DEBUG: skip deploying full build logs: not enabled in config

The mobile_scanner package fails, but I don’t know why…

Btw. I updated to the latest flutter and package versions last week and did a gradle downgrade from gradle 9.3.1 to 8.14, as some of my used packages crash with gradle 9.3.1 But as I said the current configuration works on my computer and on Github. But not on F-Droid…

The mobile_scanner package fails, but I don’t know why…

mobile_scanner is not FLOSS, as it depends on mlkit, get a replacement: FOSS libs · Wiki · F-Droid / wiki · GitLab

also run as flutter pub get --enforce-lockfile please

Ok good hint that it isn’t FLOSS. I wasn’t really aware I must say. :slight_smile: I give another package a try and also your enforce-lockfile argument and then we will see if that changes something.

So I have replaced the barcode scanner by flutter_zxing and the build runs now, I have created a pull request.