Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading Firebase dependencies release reveals the following lint error: NoSuchMethodError:IncompatibleIidVersionDetector.beforeCheckEachProject #1407

Closed
ahinchman1 opened this issue Apr 1, 2020 · 14 comments · Fixed by #1409
Assignees
Labels
type: bug Something isn't working

Comments

@ahinchman1
Copy link

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository.
If you have a general question, need help debugging, or fall into some
other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow
    with the firebase tag.
  • For general Firebase discussion, use the firebase-talk
    google group.
  • For help troubleshooting your application that does not fall under one
    of the above categories, reach out to the personalized
    Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: 3.6.2
  • Firebase Components/Versions:
    • Firebase Services: 3.6.0
    • Firebase Core: 17.3.0
    • Firebase Message: 20.1.4
    • Firebase Crashlytics: 17.0.0-beta03

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

Updated all the firebase dependencies last night only to receive the following lint error:

Execution failed for task ':app:lintDebug'.
> Lint found errors in the project; aborting build.
  
  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...
  
  Errors found:
  
  /Users/amanda.hinchman-dominguez/Documents/repos/47deg/scaladaysandroidkotlin/app: Error: Unexpected failure during lint analysis (this is a bug in lint or one of the libraries it depends on)
  
  Message: 'com.android.builder.model.AndroidProject com.android.tools.lint.detector.api.Project.getGradleProjectModel()'
  
  The crash seems to involve the detector com.google.firebase.installations.lint.IncompatibleIidVersionDetector.
  You can try disabling it with something like this:
      android {
          lintOptions {
              disable "IncompatibleIidVersion"
          }
      }
  
  Stack: NoSuchMethodError:IncompatibleIidVersionDetector.beforeCheckEachProject(IncompatibleIidVersionDetector.kt:56)←LintDriver.checkProject(LintDriver.kt:894)←LintDriver.analyze(LintDriver.kt:422)←LintCliClient.run(LintCliClient.java:238)←LintGradleClient.run(LintGradleClient.java:261)←LintGradleExecution.runLint(LintGradleExecution.java:305)←LintGradleExecution.lintSingleVariant(LintGradleExecution.java:392)←LintGradleExecution.analyze(LintGradleExecution.java:94)

I did some digging of my own - the library jars downloaded in com.google.firebase.installations appears to be missing the package for lint let alone the class itself. Furthermore, there appears to be no such class in documentation or release notes.

However, I did spot two recent commits made in roughly the last 2 weeks involving the existence of com.google.firebase.installations.lint.IncompatibleIidVersionDetector:

Relevant Code:

Insert the following dependencies in an Android project:

dependencies {
    def firebase_version = '17.3.0'

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation "androidx.multidex:multidex:2.0.1"
    implementation 'androidx.core:core-ktx:1.2.0'

    implementation "com.google.firebase:firebase-core:$firebase_version"
    implementation 'com.google.firebase:firebase-messaging:20.1.4'
    implementation "com.google.firebase:firebase-analytics:$firebase_version"
    implementation 'com.google.firebase:firebase-crashlytics:17.0.0-beta03'
}
@google-oss-bot
Copy link
Contributor

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@andirayo
Copy link
Contributor

andirayo commented Apr 1, 2020

Sorry for the inconvenience!

The error you are describing is a new LINT check that is incompatible with Gradle/AGP v3.6+.
We are getting a hotfix ready as soon as possible.
We are hoping to get it on April 1 or April 2 at the latest.

If they're using Gradle/AGP < v3.6 you should not be affected by this issue!

@ahinchman1
Copy link
Author

Sorry! I didn't see that another similar issue had also been filed - but I hope some of this information is useful

@ahinchman1
Copy link
Author

Thank you @andirayo! I really appreciate the workaround. I'll be sure to keep an eye on this issue - but until then, there is no major rush for this fix on my end!

@arcao
Copy link

arcao commented Apr 1, 2020

Hi, have the same issue. Unfortunately that broken lint check is part of BOM (Bill of Materials) artifact.

For now I disabled that check with

android {
    lintOptions {
        disable "IncompatibleIidVersion"
    }
}

as is suggested with error output.

@samtstern samtstern added type: bug Something isn't working and removed needs-triage labels Apr 1, 2020
vkryachko added a commit that referenced this issue Apr 1, 2020
AGP 3.6 introduced a breaking change to lint-api making the check fail.
The change switch to use reflection to support both versions of the api.

Additionally the change makes the check failures more developer friendly
to make sure this check does not cause failures in upcoming AGP
versions.

Versions tested: 3.2 through 4.1.0-alpha04

Fixes #1407
vkryachko added a commit that referenced this issue Apr 1, 2020
AGP 3.6 introduced a breaking change to lint-api making the check fail.
The change switch to use reflection to support both versions of the api.

Additionally the change makes the check failures more developer friendly
to make sure this check does not cause failures in upcoming AGP
versions.

Versions tested: 3.2 through 4.1.0-alpha04

Fixes #1407
@andirayo
Copy link
Contributor

andirayo commented Apr 1, 2020

#1409 contains a fix for this issue.

vkryachko added a commit that referenced this issue Apr 1, 2020
* Support AGP 3.6+ in the iid compatibility check.

AGP 3.6 introduced a breaking change to lint-api making the check fail.
The change switch to use reflection to support both versions of the api.

Additionally the change makes the check failures more developer friendly
to make sure this check does not cause failures in upcoming AGP
versions.

Versions tested: 3.2 through 4.1.0-alpha04

Fixes #1407

* Cleanup, unittests for version logic
@crossle
Copy link

crossle commented Apr 2, 2020

When release ?

@vkryachko
Copy link
Member

@crossle We are working on the release right now and hopefully it will be available today. If we face any process related delays I will update this thread. Thanks for your patience

@LouisCAD
Copy link

LouisCAD commented Apr 3, 2020

Could the update be published?

@davidmotson
Copy link
Collaborator

Hi, we are working on publishing it asap, it should be out later today.

@davidmotson
Copy link
Collaborator

Should be launched now.

@eygraber
Copy link

Not sure if related, but I just updated all of my firebase libraries, and I get the following lint error:

Error: Incompatible IID version found in variant devDebug: com.google.firebase:firebase-iid:20.0.2.

I updated:

analytics 17.2.2 -> 17.3.0
messaging 20.1.0 -> 20.1.5
perf 19.0.5 -> 19.0.6

Using AGP 4.0 Beta 4

@pranayairan
Copy link

We are facing same issue as well with all lates updated firebase libraries, Using AGP 3.6.2

@mkocus
Copy link

mkocus commented Apr 23, 2020

Same here, using:

  • AGP 3.6.3
  • analytics 17.3.0

Error: Incompatible IID version found in variant xyz: com.google.firebase:firebase-iid:20.0.2. To resolve this issue, consider updating the build file to the latest firebase-iid version. [IncompatibleIidVersion]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.