I recently created an open source application. Shortly after launching it, some users asked me to provide it on F-Droid. The main problem was that my app was using unallowed libraries (Fabric / Firebase) for Crash reporting, analytics and remote config. Since it was very basic and optional features, I decided to create a product flavor excluding Fabric and Firebase from my app, you can find the process here : Provide in F-Droid · Issue #25 · anthony-hermet/AndroidDeepL · GitHub
After these modifications, the app is able to build without including either Fabric or Firebase library by using the product flavor “withoutPlayServices”. The main problem I encounter is after creating the F-Droid metadata for the app, I runned the “fdroid build” command to test the configuration and the build failed because Fabric maven repository is still present in the build.gradle (on the project level, not app level).
So even if the build config defined in the F-Droid metadata exclude Fabric from the build, it’s still detected as present in the project. Does someone know it I can do something about it ? I don’t think I can get rid of the Fabric’s Maven repository since it’s still used in other build configs.
Here is the complete end of the fdroid build command :
BUILD SUCCESSFUL in 11s
1 actionable task: 1 up-to-date
INFO: Scanning source for common problems…
ERROR: Found unknown maven repo ‘https://maven.fabric.io/public’ at build.gradle
INFO: Removing gradle-wrapper.jar at gradle/wrapper/gradle-wrapper.jar
ERROR: Could not build app com.anthony.deepl.openl: Can’t build due to 1 error while scanning
INFO: Finished
INFO: 1 build failed
I finaly solved the problem
The main problem was the fact that the “maven { … }” part is empty when sed remove the line “url ‘https://maven.fabric.io/public’”. I also needed we needed to remove the two lines you said and also those two lines on the app build.gradle :
apply plugin: ‘io.fabric’
apply plugin: ‘com.google.gms.google-services’
Here is the final command chain I use in the pre-build instructions :
sed -n -i -e ‘/maven.fabric/{s/.*//;x;N;d;};x;p;${x;p;}’ …/build.gradle | sed ‘/^$/d’
sed -i -e ‘/io.fabric/d’ …/build.gradle
sed -i -e ‘/google-services/d’ …/build.gradle
sed -i -e ‘/io.fabric/d’ ./build.gradle
sed -i -e ‘/com.google.gms.google-services/d’ ./build.gradle
The build is now working, thanks a lot for your help !