question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Android project with facebook login fails lint

See original GitHub issue

Plugin(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:open
  • Created a year ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
robingenzcommented, Aug 8, 2022

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

0reactions
robingenzcommented, Aug 6, 2022

Unfortunately I could not find out anything more. Waiting for https://github.com/gradle/gradle/issues/21462

Read more comments on GitHub >

github_iconTop Results From Across the Web

bug: Android project with facebook login fails lint #117
Linting the android project in CI environment fails when using the facebook provider because of missing dependency. $ ./gradlew app:lint > Task ...
Read more >
facebook sdk 3.8 lint errors when exporting signed ...
My app works fine when not exporting signed application. However, it starts getting lint problem when exporting signed application. I don't ...
Read more >
Troubleshooting - Facebook Login
Commonly encountered problems and solutions for Facebook Login for Android.
Read more >
If Build fails at getting JCenter Bintray resources
If you use JCenter and Bintray resources in your AppCenter Android builds and your builds fail on Gradle Task failure (could not get...
Read more >
Known issues with Android Studio and Android Gradle Plugin
Error when using different passwords for key and keystore ... When running lint with checkDependencies = true from an app module, dynamic-feature library ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found