bug: Android project with facebook login fails lint
See original GitHub issuePlugin(s): authentication
Platform(s): android
Current behavior: Linting the android project in CI environment fails when using the facebook provider because of missing dependency.
$ ./gradlew app:lint
> Task :app:lintDebug FAILED
Lint found 2 errors, 42 warnings. First failure:
android/app/src/main/AndroidManifest.xml:124: Error: Class referenced in the manifest, com.facebook.FacebookActivity, was not found in the project or the libraries [MissingClass]
android:name="com.facebook.FacebookActivity"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The full lint text report is located at:
android/app/build/intermediates/lint_intermediate_text_report/debug/lint-results-debug.txt
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintDebug'.
> Lint found errors in the project; aborting build.
Fix the issues identified by lint, or create a baseline to see only new errors:
android { lint { baseline = file(“lint-baseline.xml”) } }
For more details, see https://developer.android.com/studio/write/lint#snapshot
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 10s
642 actionable tasks: 1 executed, 641 up-to-date
Expected behavior:
./gradle app:lint
should pass
Steps to reproduce: Implement authentication with the facebook provider according to documentation and run ./gradle app:lint
Related code:
facebookLoginVersion = '14.0.0'
<activity android:name="com.facebook.FacebookActivity"
Other information: The project builds and runs in Android Studio.
A workaround I have found is to add the dependency in my top level build.gradle
implementation "com.facebook.android:facebook-login:$facebookLoginVersion
My guess is that the linter doesn’t like that the dependency is in a subpackage while FacebookActivity
is used at the top level (in AndroidManifest.xml
). One solution is to change the documentation to say that the dependency should be added manually.
Capacitor doctor:
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 3.5.1
@capacitor/core: 3.5.1
@capacitor/android: 3.5.1
@capacitor/ios: 3.5.1
Installed Dependencies:
@capacitor/cli: 3.4.3
@capacitor/core: 3.4.3
@capacitor/android: 3.4.3
@capacitor/ios: 3.4.3
[error] Xcode is not installed
Issue Analytics
- State:
- Created a year ago
- Comments:11 (8 by maintainers)
Top GitHub Comments
I have unfortunately not received a tip either in the Gradle issue or in this discussion and have no more idea myself.
Since it is only a lint error and the project can be built normally, I will ignore the lint error in my projects with a baseline for now (see Creating a Baseline, example commit).
I will also add a note to the documentation.
Edit: Note added: https://github.com/capawesome-team/capacitor-firebase/commit/c9a5daada7d19f4631688d9ac585937a13bdfff5
Unfortunately I could not find out anything more. Waiting for https://github.com/gradle/gradle/issues/21462