Ways to build apps

how can i build my own app, using fdroid build. (if i have uploaded the source code on a public repo)

start at Building Applications | F-Droid - Free and Open Source Android App Repository

i have built from fdroid official repo, but i was wondering if i can build without internet, for example if i already have the source code, then fdroid build doesnt need to download source code right?

if the code does not use more dependencies from Maven or whatever, yes, it could

what steps are needed in order to build an app (using fdroid build) that i just wrote, because im unable to get documentation on this.

you’ve read the article linked above? at which step did you encountered issues?

so i just need to write metadata file, according to my code? and then run fdroid build.

clone fdroiddata
clone fdroidserver

add your recipe to fdroiddata/metadata/yourappid.yml

etc

it throws no apps to process.

explain the steps you took

edited fdroiddata/metadata/yourappid.yml

then run: fdroid build --verbose yourappid

yes?

yes, thats exactly what i did

Paste the exact command and output

you’ve run the fdroid command in fdroiddata folder, yes?

deepak@deech:~/fdroiddata$ fdroid build -v com.example.reg
2024-03-11 18:03:37,369 DEBUG: Reading ‘config.yml’
2024-03-11 18:03:37,760 DEBUG: Popen([‘git’, ‘cat-file’, ‘–batch-check’], cwd=/home/deepak/fdroiddata, universal_newlines=False, shell=None, istream=)
2024-03-11 18:03:38,114 DEBUG: Popen([‘git’, ‘diff’, ‘–cached’, ‘–abbrev=40’, ‘–full-index’, ‘–raw’], cwd=/home/deepak/fdroiddata, universal_newlines=False, shell=None, istream=None)
2024-03-11 18:03:38,913 DEBUG: Popen([‘git’, ‘diff’, ‘–abbrev=40’, ‘–full-index’, ‘–raw’], cwd=/home/deepak/fdroiddata, universal_newlines=False, shell=None, istream=None)
2024-03-11 18:04:04,722 DEBUG: Popen([‘git’, ‘ls-files’, ‘–modified’], cwd=/home/deepak/fdroiddata, universal_newlines=False, shell=None, istream=None)
2024-03-11 18:04:06,232 DEBUG: Popen([‘git’, ‘status’, ‘–porcelain’, ‘–untracked-files’], cwd=/home/deepak/fdroiddata, universal_newlines=False, shell=None, istream=None)
Traceback (most recent call last):
File “/usr/bin/fdroid”, line 33, in
sys.exit(load_entry_point(‘fdroidserver==2.2.1’, ‘console_scripts’, ‘fdroid’)())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/usr/lib/python3/dist-packages/fdroidserver/main.py”, line 211, in main
mod.main()
File “/usr/lib/python3/dist-packages/fdroidserver/build.py”, line 971, in main
raise FDroidException(“No apps to process.”)

please clone fdroidserver from Gitlab and use fdroid from that

can you paste the recipe for com.example.reg ?

Categories:
  - Time
License: Unknown
SourceCode: https://github.com/deepak07dbz/reg.git
Description: A simple registration application.

Builds:
  - versionName: '1.0'
    versionCode: 1

AutoUpdateMode: None
UpdateCheckMode: None
CurrentVersion: '1.0'
CurrentVersionCode: 1

NoSourceSince: '1.1'

//is there some issue with fdroidserver from apt?

/L_K code block edit

no, just that is older

ok, so fdroid needs to build the app, how do you build it? with gradle? with NDK? with c++?

Do add a LICENSE file for your actual license (pick one with FSF and/or OSI column Y: SPDX License List | Software Package Data Exchange (SPDX)

maybe start with import: fdroid import --url https://github.com/deepak07dbz/reg --verbose

So the recipe it generates is:

License: Unknown
SourceCode: https://github.com/deepak07dbz/reg
IssueTracker: https://github.com/deepak07dbz/reg/issues

RepoType: git
Repo: https://github.com/deepak07dbz/reg

Builds:
  - versionName: '1.0'
    versionCode: 1
    disable: Generated by `fdroid import` - check version fields and commitid
    commit: 2bd6c7977a57e20b862e3d1cedea145882a1bc6b
    subdir: app
    gradle:
      - yes

AutoUpdateMode: None
UpdateCheckMode: Tags

remove the disable line else it would not be build, and we add Java17 since you use gradle 8

So we end up with a good draft:

License: Unknown
SourceCode: https://github.com/deepak07dbz/reg
IssueTracker: https://github.com/deepak07dbz/reg/issues

RepoType: git
Repo: https://github.com/deepak07dbz/reg.git

Builds:
  - versionName: '1.0'
    versionCode: 1
    commit: 2bd6c7977a57e20b862e3d1cedea145882a1bc6b
    subdir: app
    sudo:
      - apt-get update
      - apt-get install -y openjdk-17-jdk-headless
      - update-java-alternatives -a
    gradle:
      - yes

AutoUpdateMode: None
UpdateCheckMode: Tags

now try to build this one :wink:

THANK YOU, the build was successful, but is there a way i can build without internet , like in metadata can i add a local path in sourceCode field instead of repo url.

disconnect from the internet (or block whatever) and run with --no-refresh as mentioned in fdroidserver/build.py · master · F-Droid / fdroidserver · GitLab

So if i just copy the source code in build directory and recipe in metadata directory, i should be able to build with no refresh flag(provided no dependencies need to be downloaded)? Right?