Page MenuHomePhabricator

Android app doesn't build for f-droid
Closed, ResolvedPublicBUG REPORT

Description

Steps to Reproduce:

Run `./gradlew assembleFdroidRelease

Actual Results:
See here: https://f-droid.org/wiki/index.php?title=org.wikipedia/lastbuild_50334&oldid=282219

Get the following lint fatal error:

> Task :app:lintVitalFdroidRelease FAILED
/home/bubu/projects/oss/fdroiddata/build/org.wikipedia/app/src/main/AndroidManifest.xml:360: Error: WikipediaFirebaseMessagingService must extend android.app.Service [Instantiatable]
            android:name=".push.WikipediaFirebaseMessagingService"
                          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "Instantiatable":
   Activities, services, broadcast receivers etc. registered in the manifest
   file (or for custom views, in a layout file) must be "instantiatable" by
   the system, which means that the class must be public, it must have an
   empty public constructor, and if it's an inner class, it must be a static
   inner class.

1 errors, 0 warnings

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintVitalFdroidRelease'.
> Lint found fatal errors while assembling a release target.
  
  To proceed, either fix the issues identified by lint, or modify your build script as follows:
  ...
  android {
      lintOptions {
          checkReleaseBuilds false
          // Or, if you prefer, you can continue to check for errors in release builds,
          // but continue the build even when errors are found:
          abortOnError false
      }
  }
  ...

Expected Results:

App gets build successfully.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Hi @Dbrant, you worked on this and as far as I can see the Fdroid flavour manifest file should correctly remove the push service. Except that apparently is either not working, or it's a lint false positive :-/.

I disabled lint failing the build, it seems the resulting apk correctly does not contain the push service definition in the manifest... so it seems to be a lint FP indeed.

Good catch, thanks!
I've made a change that will suppress lint for that specific node:
https://github.com/wikimedia/apps-android-wikipedia/pull/1759