firebase-android-sdk: `IidCompatibilityCheckFailure` lint check fails with a null pointer exception (NPE)...

IidCompatibilityCheckFailure lint check fails with a null pointer exception (NPE)…

Using bom 25.4.1 and Iid 20.2.0

The check failed to run as it encountered unknown failure. This is most likely caused by a new version of Android Gradle Plugin that this check does not support. Please make sure your build does not depend on firebase-iid version earlier than 20.1.1 as it will cause issues.

[REQUIRED] Step 2: Describe your environment

  • Android gradle plugin 4.0.0
  • Firebase Component: bom 25.4.1 and Iid 20.2.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Run lintRelease

Seems to be related to dagger 2.28, or Google places SDK 2.3.0 or androidtimesquare lib 1.7.10

About this issue

  • Original URL
  • State: open
  • Created 4 years ago
  • Reactions: 9
  • Comments: 30 (10 by maintainers)

Most upvoted comments

Hi Everyone.

Sorry for the delayed response. Yes, its a broken lint check caused by the reflection call in Firebase-Installations library resulting in this issue. I was figuring out if its safe to remove the lint check from the firebase-installations library.

We have decided on removing the lint check from Firebase Installations library by mid November. Since, this lint check failure is a weak warning, anyone getting this error please feel free to ignore it if your app depends on firebase-iid version i.e greater than 20.1.1

I will keep this issue open till we rollout the lint removal.

Thanks, Ankita

I might be seeing the same thing with a more descriptive error with Gradle 6.5.1 and Android Gradle Plugin 4.2.0-alpha04:

Check failed with exception: java.lang.NoSuchMethodException: com.android.tools.lint.detector.api.LintModelModuleProject.getGradleProjectModel()

@ankitaj224 You can check this repository to reproduce the error using Android Studio 4.1

Android Studio: 4.1 Gradle: 6.5

I created a new Empty Activity project using Android Studio 4.1. The only code I added after creating the new project was for adding Crashlytics to the project by following the instructions from the official documentation.

This commit (https://github.com/harshalbhakta/IidCompatibilityCheckFailureDemo/commit/927c869315f0bf32fd49bcb00c5b4272250bc232) has the changes I made to enable Crashlytics. Code in this commit causes below lint warnings.

Screenshot 2020-10-17 at 12 23 53 PM Screenshot 2020-10-17 at 12 23 19 PM
Check failed with exception: java.lang.NoSuchMethodException: com.android.tools.idea.lint.AndroidLintIdeProject$LintGradleProject.getGradleProjectModel()

Check failed with exception: java.lang.NoSuchMethodException: com.android.tools.idea.lint.common.LintIdeProject$LintModuleProject.getGradleProjectModel()
Firebase IID Compatibility Check Unable To Run

The check failed to run as it encountered unknown failure.
This is most likely caused by a new version of Android Gradle Plugin that this check does not support.
Please make sure your build does not depend on firebase-iid version earlier than 20.1.1 as it will cause issues. 

Issue id: IidCompatibilityCheckFailure

Hi @chrisjenx

Yes, as part of the firebase-installations v16.3.5 release, this lint check has been removed from the library(firebase-installations) that introduced it.

Only firebase-messaging library has released a new version 21.0.1 that uses the latest version of firebase-installations. So, if you see this lint check warning been in your project due to a dependency on firebase-messaging. Update to the latest version of firebase-messaging v21.0.1 which will resolve this issue.

However, not all firebase libraries that depend on older version of firebase-installations have updated to the version that removes the lint check. Reason being different firebase libraries follow different release schedule. Note: This issue is a lint warning and not causing any major build failures.

A reasonable solution would be explicitly defining & updating the dependency on the firebase-installations library with the fix (v16.3.5) in your build file. Meanwhile, we will continue working with other firebase libraries to release with the newer version of firebase-installations.

Please let me know if you have any questions.

Thanks, Ankita

@kenyee use disable 'IidCompatibilityCheckFailure'

Similarly, I just started seeing this after I updated to Gradle Plugin 4.1.0 with Gradle 6.5:

/Volumes/android/android-application/mobile: Information: Check failed with exception: java.lang.NoSuchMethodException: com.android.tools.lint.detector.api.LintModelModuleProject.getGradleProjectModel() [IidCompatibilityCheckFailure]

   Explanation for issues of type "IidCompatibilityCheckFailure":
   The check failed to run as it encountered unknown failure.
   This is most likely caused by a new version of Android Gradle Plugin that
   this check does not support.
   Please make sure your build does not depend on firebase-iid version earlier
   than 20.1.1 as it will cause issues.

Our dependencies show that we’re using com.google.firebase:firebase-iid:20.3.0, so we should be over the version mentioned here.

I started to get the same issue in Android Studio when performing a code inspection.

Gradle: 6.1.1

Firebase dependencies: implementation ‘com.google.firebase:firebase-analytics:17.4.4’ implementation ‘com.google.firebase:firebase-ml-vision:24.0.3’ implementation ‘com.google.firebase:firebase-ml-vision-face-model:20.0.1’

image

also FYI, disable ‘IidCompatibilityCheckFailure’ doesn’t work if you apply it to all modules… lint complains that the rule doesn’t exist if that module doesn’t use a firebase lib.

Would be nice if this were fixed in the firebase lint rule though…or just take out the entire rule out of Firebase for now until it gets fixed so we don’t need this workaround…

I’m having this issue too since AGP 4.1, and I could reproduce it with @harshalbhakta project 👍

@petedoyle Thanks for posting the descriptive error. This is super helpful.

I’ve found out that “firebase-ml-vision-face-model:20.0.1” has been deprecated, I removed it as it would had made sense that this could be the issue based in the lint notes about the 20.1.1 minimal version requirement. But, this issue still happens using only the next 2 dependencies:

    implementation 'com.google.firebase:firebase-analytics:17.4.4'
    implementation 'com.google.firebase:firebase-ml-vision:24.0.3'

PS: Make sure to perform a “whole project” code inspection in order to reproduce the issue. For a moment I thought it was solved after I removed the deprecated library, yet I missed this setting.

@ankitaj224

Gradle version: 6.1.1 Android Studio: 4.0

In case is of any use, the lint warning appears when performing a code inspection at “whole project” level

Yes, it is a nullpointerexception, but not sure how to get lint to print the full stack trace.